-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update usage.md * Update run_on_sumner.md * add dockerfile for csvtoolkit * add process to convert manifest json to csv * add process to filter manifest by file passed through --reads * update help message * fix bug on variable declaration * Update nextflow.config - fix typo * Revert "Merge branch 'master' into dev-v2.1-#287" This reverts commit be2c2ab, reversing changes made to 04285ef. * Update main.nf * patch projectDir error * Fix oublishDir path for manifest * Fix oublishDir path for manifest * Fix typo * Update filter_manifest.py * Update filter_manifest.py * fix bug on saving filenames that were not in manifest file * Update filter_manifest.py * remove logging of samples not found in manifest * Update filter_manifest.py * Makes filter_manifest txt output optional Co-authored-by: angarb <62404570+angarb@users.noreply.github.com> Co-authored-by: Vlad-Dembrovskyi <64809705+Vlad-Dembrovskyi@users.noreply.github.com> Co-authored-by: Vlad-Dembrovskyi <vlad@lifebit.ai>
- Loading branch information
1 parent
8beff37
commit 7bd8f1d
Showing
5 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
import shutil | ||
import pandas as pd | ||
|
||
def __main__(): | ||
|
||
manifest = sys.argv[1] | ||
reads = sys.argv[2] | ||
print("Input manifest file:", manifest) | ||
print("Input read file: ", reads) | ||
|
||
manifest_df = pd.read_csv(manifest, index_col=None, header=0, delimiter=",") | ||
|
||
if reads != "PASS": | ||
# process metadata | ||
reads_df = pd.read_csv(reads, index_col=None, header=0, delimiter=",") | ||
manifest_df = manifest_df[manifest_df['file_name'].isin(reads_df['file_name'].tolist())] | ||
|
||
if manifest_df.empty: | ||
print("Manifest file is empty after filtering.") | ||
sys.exit(404, "Manifest file is empty after filtering.") | ||
else: | ||
print("Number of samples in filtered manifest:") | ||
print(len(manifest_df)) | ||
|
||
# save final manifest file | ||
manifest_df.to_csv("filtered_manifest.csv", sep=",", index=False) | ||
|
||
if __name__=="__main__": __main__() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM nfcore/base:1.9 | ||
LABEL authors="ines@lifebit.ai" \ | ||
description="Docker image containing csvkit toolkit, including in2csv" | ||
|
||
COPY environment.yml / | ||
RUN conda env create -f /environment.yml && conda clean -a | ||
ENV PATH /opt/conda/envs/csvkit/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: csvkit | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
- anaconda | ||
dependencies: | ||
- python=3.8 | ||
- csvkit=1.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters