-
Notifications
You must be signed in to change notification settings - Fork 1
simplifying code and adding resources.yml #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9464d2b
a6ffcc5
b371545
a2077b0
77fc60e
6e05385
766bec5
b6032b8
ffdae88
43a931f
5cf7de8
d11ba2a
8e6267a
0071e1c
80373a0
50a46cf
9a44417
fb42f44
bdb82df
0cd35e7
a58a1f2
d2b227c
741e242
52d76b2
6af6c17
f98217e
af437dd
b9b5c76
e58bb16
9098888
15bbe41
a2775aa
c6193a5
23fdf69
9d7fcb8
e82c2f3
2286019
813d03b
4a1fd74
20be910
75344ca
f694914
b203403
5c9b92d
5969f77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,15 @@ build-backend = "setuptools.build_meta" | |
|
|
||
| [tool.setuptools] | ||
| packages = ["qp_pacbio"] | ||
| include-package-data = true | ||
|
|
||
| [tool.setuptools.package-data] | ||
| "qp_pacbio" = ["data/*"] | ||
|
|
||
| [project] | ||
| name = "qp_pacbio" | ||
| # version strings must comply with PEP 440: | ||
| # https://peps.python.org/pep-0440/ | ||
| version = "2025.09" | ||
| version = "2025.11" | ||
| authors = [{ name = "Qiita Development Team", email = "[email protected]" }] | ||
| description = "Qiita Plugin: PacBio Processing" | ||
| readme = "README.rst" | ||
|
|
@@ -39,11 +41,15 @@ dependencies = [ | |
| 'pytest-cov', | ||
| 'numpy', | ||
| 'Jinja2', | ||
| 'PyYAML', | ||
| "qiita-files@https://github.com/qiita-spots/qiita-files/archive/master.zip", | ||
| "qiita_client@https://github.com/qiita-spots/qiita_client/archive/master.zip", | ||
| "woltka@git+https://github.com/qiyunzhu/woltka.git#egg=woltka", | ||
| "micov@git+https://github.com/biocore/micov.git#egg=micov", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| configure_qp_pacbio = "qp_pacbio.scripts:config" | ||
| start_qp_pacbio = "qp_pacbio.scripts:execute" | ||
| finish_qp_pacbio = "qp_pacbio.scripts:finish_qp_pacbio" | ||
| biom_merge_pacbio = "qp_pacbio.scripts:biom_merge" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| PacBio processing: | ||
| step-1: | ||
| node_count: 1 | ||
| nprocs: 16 | ||
| wall_time_limit: 1-00:00:00 | ||
| mem_in_gb: 200 | ||
| max_tasks: 16 | ||
| step-2: | ||
| node_count: 1 | ||
| nprocs: 1 | ||
| wall_time_limit: 00:10:00 | ||
| mem_in_gb: 2 | ||
| max_tasks: 16 | ||
| step-3: | ||
| node_count: 1 | ||
| nprocs: 8 | ||
| wall_time_limit: 01:00:00 | ||
| mem_in_gb: 10 | ||
| max_tasks: 16 | ||
| step-4: | ||
| node_count: 1 | ||
| nprocs: 8 | ||
| wall_time_limit: 01:00:00 | ||
| mem_in_gb: 6 | ||
| max_tasks: 16 | ||
| step-5: | ||
| node_count: 1 | ||
| nprocs: 8 | ||
| wall_time_limit: 00:30:00 | ||
| mem_in_gb: 2 | ||
| max_tasks: 16 | ||
| step-6: | ||
| node_count: 1 | ||
| nprocs: 8 | ||
| wall_time_limit: 00:30:00 | ||
| mem_in_gb: 2 | ||
| max_tasks: 16 | ||
| step-7: | ||
| node_count: 1 | ||
| nprocs: 8 | ||
| wall_time_limit: 01:00:00 | ||
| mem_in_gb: 50 | ||
| max_tasks: 16 | ||
| finish: | ||
| node_count: 1 | ||
| nprocs: 1 | ||
| wall_time_limit: 00:10:00 | ||
| mem_in_gb: 10 | ||
| Woltka v0.1.7, minimap2: | ||
| minimap2: | ||
| node_count: 1 | ||
| nprocs: 16 | ||
| wall_time_limit: 10:00:00 | ||
| mem_in_gb: 60 | ||
| max_tasks: 16 | ||
| merge: | ||
| node_count: 1 | ||
| nprocs: 16 | ||
| wall_time_limit: 1-00:00:00 | ||
| mem_in_gb: 120 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| #!/bin/bash | ||
| #SBATCH -J {{job_name}} | ||
| #SBATCH -p qiita | ||
| #SBATCH -N {{node_count}} | ||
| #SBATCH -n {{nprocs}} | ||
| #SBATCH --time {{wall_time_limit}} | ||
| #SBATCH --mem {{mem_in_gb}}G | ||
| #SBATCH -o {{output}}/step-2/logs/%x-%A_%a.out | ||
| #SBATCH -e {{output}}/step-2/logs/%x-%A_%a.err | ||
| #SBATCH --array {{array_params}} | ||
|
|
||
| source ~/.bashrc | ||
| set -e | ||
| {{conda_environment}} | ||
| cd {{output}}/step-1 | ||
|
|
||
| step=${SLURM_ARRAY_TASK_ID} | ||
| input=$(head -n $step {{output}}/sample_list.txt | tail -n 1) | ||
| sample_name=`echo $input | awk '{print $1}'` | ||
| filename=`echo $input | awk '{print $2}'` | ||
| fn=`basename ${filename}` | ||
|
|
||
| # updating the GUI when task 1 runs | ||
| if [[ "$step" == "1" ]]; then | ||
| python -c "from qp_pacbio.util import client_connect; qclient = client_connect('{{url}}'); qclient.update_job_step('{{qjid}}', 'Running step 2: ${SLURM_ARRAY_JOB_ID}')" | ||
| fi | ||
|
|
||
| cat ${sample_name}.p_ctg.gfa | awk '$1=="S" && ($2 ~ /.c$/) {printf ">%s\n%s\n", $2, $3} ' > ../step-2/${sample_name}_circ.fa | ||
| seqkit split --by-id ../step-2/${sample_name}_circ.fa -O ../step-2/${sample_name}_split | ||
|
|
||
| ### get all contigs for each sample | ||
| cat ${sample_name}.p_ctg.gfa | awk '$1=="S" {printf ">%s\n%s\n", $2, $3} ' > ../step-2/${sample_name}_all_contigs.fa | ||
|
|
||
| cd ../step-2/${sample_name}_split | ||
| # making a copy of the small_LCG before they are removed | ||
| mkdir -p {{output}}/step-2/${sample_name}_small_LCG | ||
| find . -maxdepth 1 -type f -size -512k -print0 | xargs -0 -r cp -t ../${sample_name}_small_LCG | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So small_LCG is defined by files in size < 512kb? Probably important to note in the documentation for the PacBio workflow.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was expecting small_LCG to be defined by total genome size
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jianshu93, can you comment?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by file size for now. Can be optimized, they are proportational to total genome size.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. approximate 515,000 bases (half a million), because one character takes one byte approximately. |
||
| ### remove small circular genomes | ||
| find . -type f -size -512k -exec rm -f {} + | ||
|
|
||
| # this can result on not having any files left so | ||
| # making sure we have files left | ||
| # | ||
| # extract fasta id for all the genomes in the split folder | ||
| FILES=(*.fa) | ||
| if [ -f $FILES ]; then | ||
| for f in *.fa; do | ||
| k=${f##*/} | ||
| n=${f%.*} | ||
| grep -E "^>" $f >> circular_id.txt | ||
| done | ||
| sed -i 's/>//' circular_id.txt | ||
| seqkit grep -v -f circular_id.txt ../${sample_name}_all_contigs.fa > ../${sample_name}_noLCG.fa | ||
| else | ||
| cp ../${sample_name}_all_contigs.fa ../${sample_name}_noLCG.fa | ||
| fi | ||
|
|
||
| lcg_folder={{result_fp}}/${sample_name}/LCG/ | ||
| mkdir -p ${lcg_folder} | ||
| FILES=({{output}}/step-2/${sample_name}_split/*.fa) | ||
| if [ -f $FILES ]; then | ||
| for f in `ls {{output}}/step-2/${sample_name}_split/*.fa`; do | ||
| sn=`basename ${f/_circ/}`; | ||
| sn=${sn/part_/}; | ||
| cat $f | gzip > ${lcg_folder}/${sn/.fa/.fna}.gz; | ||
| done | ||
| fi | ||
|
|
||
| mkdir -p {{result_fp}}/${sample_name}/ | ||
| if [ -f {{output}}/step-2/${sample_name}_noLCG.fa ]; then | ||
| cat {{output}}/step-2/${sample_name}_noLCG.fa | gzip > {{result_fp}}/${sample_name}/${sample_name}.noLCG.fna.gz | ||
| fi | ||
|
|
||
| touch {{output}}/step-2/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| # if the files don't exist, it means that this step didn't generate any | ||
| # inputs for the next step; thus generating all the completed files | ||
| if [[ ! -f "$FILES" && ! -f "{{output}}/step-2/${sample_name}_noLCG.fa" ]]; then | ||
| touch {{output}}/step-3/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| touch {{output}}/step-4/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| touch {{output}}/step-5/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| touch {{output}}/step-6/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| touch {{output}}/step-7/completed_${SLURM_ARRAY_TASK_ID}.log | ||
| fi | ||
|
|
||
| # saving small LCG, note that these are not processed downstrem so not | ||
| # relevant to the "complete" files | ||
| small_lcg_folder={{result_fp}}/${sample_name}/small_LCG/ | ||
| mkdir -p ${small_lcg_folder} | ||
| FILES=({{output}}/step-2/${sample_name}_small_LCG/*.fa) | ||
| if [ -f $FILES ]; then | ||
| for f in `ls {{output}}/step-2/${sample_name}_small_LCG/*.fa`; do | ||
| sn=`basename ${f/_circ/}`; | ||
| sn=${sn/part_/}; | ||
| cat $f | gzip > ${small_lcg_folder}/${sn/.fa/.fna}.gz; | ||
| done | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor but you can probably get micov from
pipnow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we can install from bioconda