-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from itrujnara/bug_fixes
Added MultiQC
- Loading branch information
Showing
11 changed files
with
293 additions
and
14 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
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,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Written by Igor Trujnara, released under the MIT license | ||
# See https://opensource.org/license/mit for details | ||
|
||
import csv | ||
import sys | ||
|
||
|
||
def main() -> None: | ||
""" | ||
Convert numbers of hits into CSV. | ||
""" | ||
if len(sys.argv) < 3: | ||
print("Usage: python make_hit_table.py <merged_csv> <sample_id>") | ||
sys.exit(1) | ||
|
||
# Read the CSV into a list of lists, it has a header | ||
with open(sys.argv[1]) as f: | ||
reader = csv.DictReader(f) | ||
data = list(reader) | ||
|
||
sample_id = sys.argv[2] | ||
|
||
# Get list of databases | ||
databases = list(data[0].keys())[1:] | ||
|
||
# Get counts | ||
sums = {db: sum(int(row[db]) for row in data) for db in databases} | ||
|
||
# Print the header | ||
print("id," + ",".join(databases)) | ||
|
||
# Print the data | ||
print(sample_id + "," + ",".join(str(sums[db]) for db in databases)) | ||
|
||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
process MAKE_HITS_TABLE { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "conda-forge::python=3.11.0 conda-forge::biopython=1.83.0 conda-forge::requests=2.31.0" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' : | ||
'biocontainers/mulled-v2-bc54124b36864a4af42a9db48b90a404b5869e7e:5258b8e5ba20587b7cbf3e942e973af5045a1e59-0' }" | ||
|
||
input: | ||
tuple val(meta), path(merged_csv) | ||
|
||
output: | ||
tuple val(meta), path('*hits_table.csv'), emit: hits_table | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
prefix = task.ext.prefix ?: meta.id | ||
""" | ||
make_hits_table.py $merged_csv ${meta.id} > ${prefix}_hits_table.csv | ||
cat <<- END_VERSIONS > versions.yml | ||
"${task.process}": | ||
Python: \$(python3 --version | cut -d ' ' -f 2) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}_hits_table.csv | ||
cat <<- END_VERSIONS > versions.yml | ||
"${task.process}": | ||
Python: \$(python3 --version | cut -d ' ' -f 2) | ||
END_VERSIONS | ||
""" | ||
} |
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
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
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
Oops, something went wrong.