Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
msa-limit-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rohmer Coralie
msa-limit-data
Commits
151b3efb
Commit
151b3efb
authored
3 years ago
by
Rohmer Coralie
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
745fc121
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Snakefile
+189
-41
189 additions, 41 deletions
Snakefile
src/__pycache__/tool_consensus.cpython-37.pyc
+0
-0
0 additions, 0 deletions
src/__pycache__/tool_consensus.cpython-37.pyc
src/config_conda.sh
+0
-14
0 additions, 14 deletions
src/config_conda.sh
with
189 additions
and
55 deletions
Snakefile
+
189
−
41
View file @
151b3efb
...
...
@@ -25,9 +25,12 @@ REF_ECOLI="GCF_004358385.1_ASM435838v1_genomic.fna"
READS_CCN="ERR4352155.fastq"
READS_BMB="ERR4352154.fastq"
READS_ILLUMINA_CCN="ERR1308732.fastq"
READS_ILLUMINA_BMB="ERR1308675.fastq"
REF_CCN="ccnscafold.fa"
REF_BMB="bmbscafold.fa"
ID_YEAST=["CCN","BMB","diploid"]
ID=["CCN_yeast","BMB_yeast","diploid_yeast","ecoli_hifi","ecoli_illumina"]
CONFIGS=["","_clustal","_tcoffee"]
READS_HUMAN="reads.fastq"
REF_HUMAN="chm13.draft_v1.1.fasta"
...
...
@@ -36,11 +39,9 @@ REF_HUMAN="chm13.draft_v1.1.fasta"
#-------------------------------------------------------------------------------
rule all :
input :
expand(os.path.join('simulated_data','config_simulated_{id}_{error}.yaml'), id=ID_SIM ,error=ERROR_SIM),
os.path.join('ecoli_hifi_data','config_ecoli_hifi.yaml'),
os.path.join('ecoli_illumina_data','config_ecoli_illumina.yaml'),
expand(os.path.join('yeast_data','config_{id}_yeast.yaml'), id=ID_YEAST),
os.path.join('human_data','aln_nanopore_ref_chm13.sam')
expand(os.path.join('configuration_files','config{config}_simulated_{id}_{error}.yaml'), config=CONFIGS, id=ID_SIM ,error=ERROR_SIM),
expand(os.path.join('configuration_files','config{config}_{id}.yaml'), config=CONFIGS,id=ID),
#os.path.join('human_data','aln_nanopore_ref_chm13.sam')
#-------------------------------------------------------------------------------
# Human data
#-------------------------------------------------------------------------------
...
...
@@ -64,12 +65,13 @@ rule download_human_ref :
ref=os.path.join('human_data',REF_HUMAN),
chrX=os.path.join('human_data',"ref_chrX_W.fasta"),
message :
"Download nanopore re
ads
for human data"
"Download nanopore re
f
for human data"
log:
os.path.join('logs','human_data','2_download_ref.log')
conda:
"env_conda/gzip.yaml"
shell:
'set +o pipefail;'
'wget https://s3-us-west-2.amazonaws.com/human-pangenomics/T2T/CHM13/assemblies/chm13.draft_v1.1.fasta.gz -o {log};'
'gunzip ' + REF_HUMAN + '.gz >>{log} 2>&1;'
'mv ' + REF_HUMAN + ' {output.ref};'
...
...
@@ -145,6 +147,7 @@ rule select_hifi_reads_ecoli :
conda:
"env_conda/seqkit.yaml"
shell:
'set +o pipefail;'
'seqkit sort -l -r {input} 2>{log}|head -100000 >{output} 2>{log}'
rule assembly_hifi_reads_ecoli :
...
...
@@ -159,7 +162,7 @@ rule assembly_hifi_reads_ecoli :
conda:
"env_conda/flye.yaml"
shell:
'flye --pacbio-hifi {input} --genome-size 5m --threads ' + THREAD + ' -i 2 -o assembly_hifi >{log} 2>&1'
'flye --pacbio-hifi {input} --genome-size 5m --threads ' + THREAD + ' -i 2 -o
ecoli_hifi_data/
assembly_hifi >{log} 2>&1'
rule extract_first_contig_hifi_reads :
input :
...
...
@@ -171,14 +174,15 @@ rule extract_first_contig_hifi_reads :
log:
os.path.join('logs','ecoli_hifi_data','6_extract_first_contig_hifi_reads.log')
shell:
'cat {input}|tr "\n" "@"|sed "s/@>/\n>/g"|sed "s/@/\n/;s/@//g"|head -2 >{output} 2>{log}'
'set +o pipefail;'
'cat {input}|tr "\\n" "@"|sed "s/@>/\\n>/g"|sed "s/@/\\n/;s/@//g"|head -2 >{output} 2>{log}'
rule configuration_file_ecoli_hifi_data:
input :
ref=os.path.join('ecoli_hifi_data','ref_ecoli_hifi.fasta'),
reads=os.path.join('ecoli_hifi_data',READS_NANOPORE_ECOLI_HIFI)
output :
ref=os.path.join('
ecoli_hifi_data
','config_ecoli_hifi.yaml')
ref=os.path.join('
before_configuration_files
','config_ecoli_hifi.yaml')
message :
"Configuration file for ecoli hifi"
log:
...
...
@@ -332,7 +336,7 @@ rule configuration_file_ecoli_illumina_data:
ref=os.path.join('ecoli_illumina_data','ref_illumina_ecoli.fasta'),
reads=os.path.join('ecoli_illumina_data',READS_NANOPORE_ECOLI_ILLUMINA)
output :
ref=os.path.join('
ecoli_illumina_data
','config_ecoli_illumina.yaml')
ref=os.path.join('
before_configuration_files
','config_ecoli_illumina.yaml')
message :
"Configuration file for ecoli illumina"
log:
...
...
@@ -399,31 +403,116 @@ rule gunzip_BMB_yeast_reads :
shell:
'gunzip {input} >{log} 2>&1'
rule download_reduced_ref_CCN:
rule download_CCN_yeast_reads_illumina :
output :
os.path.join('yeast_data',READS_ILLUMINA_CCN + '.gz')
message :
"Download CCN reads illumina for yeast data"
log:
os.path.join('logs','yeast_data','5_download_CCN_reads_illumina.log')
conda:
"env_conda/fastq-dump.yaml"
shell:
'fastq-dump --gzip --split-spot ERR1308732 >{log} 2>&1;'
'mv ' + READS_ILLUMINA_CCN + '.gz {output}'
rule gunzip_CCN_yeast_reads_illumina :
input :
os.path.join('yeast_data',READS_ILLUMINA_CCN + '.gz')
output :
os.path.join('yeast_data',READS_ILLUMINA_CCN)
message :
"Decompress illumina reads for CCN yeast"
log:
os.path.join('logs','yeast_data','6_gunzip_CCN_reads_illumina.log')
conda:
"env_conda/gzip.yaml"
shell:
'gunzip {input} >{log} 2>&1'
rule download_BMB_yeast_reads_illumina :
output :
os.path.join('yeast_data',READS_ILLUMINA_BMB + '.gz')
message :
"Download BMB reads illumina for yeast data"
log:
os.path.join('logs','yeast_data','7_download_BMB_reads_illumina.log')
conda:
"env_conda/fastq-dump.yaml"
shell:
'fastq-dump --gzip --split-spot ERR1308675 >{log} 2>&1;'
'mv ' + READS_ILLUMINA_BMB + '.gz {output}'
rule gunzip_BMB_yeast_reads_illumina :
input :
os.path.join('yeast_data',READS_ILLUMINA_BMB + '.gz')
output :
os.path.join('yeast_data',READS_ILLUMINA_BMB)
message :
"Decompress illumina reads for BMB yeast"
log:
os.path.join('logs','yeast_data','8_gunzip_BMB_reads_illumina.log')
conda:
"env_conda/gzip.yaml"
shell:
'gunzip {input} >{log} 2>&1'
rule assembly_illumina_reads_CCN :
input :
illumina=os.path.join('yeast_data',READS_ILLUMINA_CCN + '.gz'),
nanopore=os.path.join('yeast_data',READS_CCN)
output:
os.path.join('yeast_data','assembly_illumina_CCN','contigs.fasta')
message :
"Assembly illumina reads for CCN yeast data with spades"
log:
os.path.join('logs','yeast_data','9_assembly_illumina_reads_ccn.log')
conda:
"env_conda/spades.yaml"
shell:
'spades.py --12 {input.illumina} --nanopore {input.nanopore} -o yeast_data/assembly_illumina_CCN --only-assembler -t '+THREAD+' >{log} 2>&1'
rule assembly_illumina_reads_BMB :
input :
illumina=os.path.join('yeast_data',READS_ILLUMINA_BMB + '.gz'),
nanopore=os.path.join('yeast_data',READS_BMB)
output:
ref=os.path.join('yeast_data',REF_CCN),
reduced_ref=os.path.join('yeast_data',"reduced_CCN.fasta")
os.path.join('yeast_data','assembly_illumina_BMB','contigs.fasta')
message :
"Download reference
for
CCN
yeast"
"Assembly illumina reads
for
BMB
yeast
data with spades
"
log:
os.path.join('logs','yeast_data','5_download_reduced_CCN_ref.log')
os.path.join('logs','yeast_data','10_assembly_illumina_reads_BMB.log')
conda:
"env_conda/spades.yaml"
shell:
#'wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/005/845/GCF_000005845.2_ASM584v2/GCF_000005845.2_ASM584v2_genomic.fna.gz -o {log} ;'
'cp ' + REF_CCN + ' {output.ref};'
'head -42442 {output.ref} |tail -11976 >{output.reduced_ref} 2>>{log}'
'spades.py --12 {input.illumina} --nanopore {input.nanopore} -o yeast_data/assembly_illumina_BMB --only-assembler -t '+THREAD+' >{log} 2>&1'
rule download_reduced_ref_BMB:
rule reduced_ref_CCN:
input :
os.path.join('yeast_data','assembly_illumina_CCN','contigs.fasta')
output :
ref=os.path.join('yeast_data',REF_BMB),
reduced_ref=os.path.join('yeast_data',"reduced_BMB.fasta")
os.path.join('yeast_data',"reduced_CCN.fasta")
message :
"
Downloa
d reference for
BMB
yeast"
"
Reduce
d reference for
CCN
yeast"
log:
os.path.join('logs','yeast_data','
6_download
_reduced_
BMB
_ref.log')
os.path.join('logs','yeast_data','
11
_reduced_
CCN
_ref.log')
shell:
#'wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/005/845/GCF_000005845.2_ASM584v2/GCF_000005845.2_ASM584v2_genomic.fna.gz -o {log} ;'
'cp ' + REF_BMB + ' {output.ref};'
'head -15288 {output.ref} >{output.reduced_ref} 2>>{log}'
'set +o pipefail;'
'head -42442 {input} |tail -11976 >{output} 2>>{log}'
rule reduced_ref_BMB:
input :
os.path.join('yeast_data','assembly_illumina_BMB','contigs.fasta')
output :
os.path.join('yeast_data',"reduced_BMB.fasta")
message :
"Reduced reference for BMB yeast"
log:
os.path.join('logs','yeast_data','12_reduced_BMB_ref.log')
shell:
'set +o pipefail;'
'head -15288 {input} >{output} 2>>{log}'
rule align_ref_BMB_ref_CCN :
input :
...
...
@@ -434,7 +523,7 @@ rule align_ref_BMB_ref_CCN :
message :
"Align BMB ref with CCN ref with minimap"
log:
os.path.join('logs','yeast_data','
7
_align_ref_BMB_ref_CCN.log')
os.path.join('logs','yeast_data','
13
_align_ref_BMB_ref_CCN.log')
conda:
"env_conda/minimap2.yaml"
shell:
...
...
@@ -448,7 +537,7 @@ rule reads_map_region_yeast :
message:
"Reads map region for yeast data"
log:
os.path.join('logs','yeast_data','
8
_reads_map_region.log')
os.path.join('logs','yeast_data','
14
_reads_map_region.log')
conda:
"env_conda/perl.yaml"
shell :
...
...
@@ -464,7 +553,7 @@ rule region_seq_yeast :
message:
"Region seq for yeast data"
log:
os.path.join('logs','yeast_data','
9
_region_seq_yeast.log')
os.path.join('logs','yeast_data','
15
_region_seq_yeast.log')
shell :
'DEB=158700;END=453600;'
'echo $DEB >{output.start};'
...
...
@@ -476,11 +565,11 @@ rule configuration_file_CCN_yeast_data:
ref=os.path.join('yeast_data','ref_ccn.fasta'),
reads=os.path.join('yeast_data',READS_CCN)
output :
os.path.join('
yeast_data
','config_CCN_yeast.yaml')
os.path.join('
before_configuration_files
','config_CCN_yeast.yaml')
message :
"Configuration file for CCN yeast data"
log:
os.path.join('logs','yeast_data','1
0
_configuration_file_CCN_yeast_data.log')
os.path.join('logs','yeast_data','1
6
_configuration_file_CCN_yeast_data.log')
shell:
'PATH_DATA=`pwd`;'
'echo -e "N: CCN_yeast" >{output};'
...
...
@@ -492,11 +581,11 @@ rule configuration_file_BMB_yeast_data:
ref=os.path.join('yeast_data','ref_bmb.fasta'),
reads=os.path.join('yeast_data',READS_BMB)
output :
os.path.join('
yeast_data
','config_BMB_yeast.yaml')
os.path.join('
before_configuration_files
','config_BMB_yeast.yaml')
message :
"Configuration file for BMB yeast data"
log:
os.path.join('logs','yeast_data','1
1
_configuration_file_BMB_yeast_data.log')
os.path.join('logs','yeast_data','1
7
_configuration_file_BMB_yeast_data.log')
shell:
'PATH_DATA=`pwd`;'
'echo -e "N: BMB_yeast" >{output};'
...
...
@@ -512,8 +601,9 @@ rule diploid_reads:
message :
"Creation of diploid yeast reads"
log:
os.path.join('logs','yeast_data','1
2
_diploid_reads.log')
os.path.join('logs','yeast_data','1
8
_diploid_reads.log')
shell:
'set +o pipefail;'
'cat {input.bmb} |head -260000 >{output};'
'cat {input.ccn} |head -260000 >>{output}'
...
...
@@ -525,7 +615,7 @@ rule diploid_reads_shuffle:
message :
"Shuffle diploid reads for yeast data"
log:
os.path.join('logs','yeast_data','1
3
_diploid_reads_shuffle.log')
os.path.join('logs','yeast_data','1
9
_diploid_reads_shuffle.log')
shell:
'./src/shuffle_fastq.pl {input} >{output} 2>{log}'
...
...
@@ -538,7 +628,7 @@ rule align_ref_BMB_ref_CCN_exonerate :
message :
"Align BMB ref with CCN ref with exonerate"
log:
os.path.join('logs','yeast_data','
14
_align_ref_BMB_ref_CCN_exonerate.log')
os.path.join('logs','yeast_data','
20
_align_ref_BMB_ref_CCN_exonerate.log')
conda:
"env_conda/exonerate.yaml"
shell:
...
...
@@ -552,7 +642,7 @@ rule ref_diploide :
message :
"Creation of diploid yeast ref"
log:
os.path.join('logs','yeast_data','1
5
_ref_diploid.log')
os.path.join('logs','yeast_data','
2
1_ref_diploid.log')
conda:
"env_conda/python3.yaml"
shell:
...
...
@@ -563,11 +653,11 @@ rule configuration_file_diploid_yeast_data:
ref=os.path.join('yeast_data','ref_diploid.fasta'),
reads=os.path.join('yeast_data','diploid_reads_shuffle.fastq')
output :
os.path.join('
yeast_data
','config_diploid_yeast.yaml')
os.path.join('
before_configuration_files
','config_diploid_yeast.yaml')
message :
"Configuration file for diploid yeast data"
log:
os.path.join('logs','yeast_data','
16
_configuration_file_diploid_yeast_data.log')
os.path.join('logs','yeast_data','
22
_configuration_file_diploid_yeast_data.log')
shell:
'PATH_DATA=`pwd`;'
'echo -e "N: diploid_yeast" >{output};'
...
...
@@ -693,7 +783,7 @@ rule configuration_file_simulated_data:
ref=os.path.join('simulated_data',REF_SIM),
reads=os.path.join('simulated_data','simulated_{id_sim}_{error_sim}_0001.fastq')
output :
ref=os.path.join('
simulated_data
','config_simulated_{id_sim}_{error_sim}.yaml')
ref=os.path.join('
before_configuration_files
','config_simulated_{id_sim}_{error_sim}.yaml')
message :
"Configuration file for simulated data ({wildcards.id_sim}_{wildcards.error_sim})"
log:
...
...
@@ -704,3 +794,61 @@ rule configuration_file_simulated_data:
'echo -e "N: $NAME_SIMULATED" >{output};'
'echo -e "I: $PATH_DATA/{input.ref}" >>{output};'
'echo -e "R: $PATH_DATA/{input.reads}" >>{output}'
#-------------------------------------------------------------------------------
# Configuration files
#-------------------------------------------------------------------------------
rule configuration_files:
input :
os.path.join('before_configuration_files','config_{id}.yaml')
output :
os.path.join('configuration_files','config_{id}.yaml')
message :
"Configuration files ({wildcards.id})"
log:
os.path.join('logs','configuration_files','1_configuration_files_{id}.log')
shell:
'cp {input} {output};'
'echo -e "D: [10,20,50,100,150,200]" >>{output};'
'echo -e "S: [100,200,500,1000,2000,5000,10000]" >>{output};'
'echo -e "T: 50" >>{output};'
'echo -e "M: [muscle,mafft,poa,spoa,abpoa,kalign,kalign3]" >>{output};'
'echo -e "O: 10" >>{output}'
rule configuration_files_for_clustal:
input :
os.path.join('before_configuration_files','config_{id}.yaml')
output :
os.path.join('configuration_files','config_clustal_{id}.yaml')
message :
"Configuration files for clustal ({wildcards.id})"
log:
os.path.join('logs','configuration_files','2_configuration_files_for_clustal_{id}.log')
shell:
'set +o pipefail;'
'head -1 {input}| sed "s/$/_clustal/" >{output};'
'tail -2 {input} >>{output};'
'echo -e "D: [10,20,50,100,150,200]" >>{output};'
'echo -e "S: [100,200,500,1000,2000,5000,10000]" >>{output};'
'echo -e "T: 50" >>{output};'
'echo -e "M: [clustalo]" >>{output};'
'echo -e "O: 10" >>{output}'
rule configuration_files_for_tcoffee:
input :
os.path.join('before_configuration_files','config_{id}.yaml')
output :
os.path.join('configuration_files','config_tcoffee_{id}.yaml')
message :
"Configuration files for tcoffee ({wildcards.id})"
log:
os.path.join('logs','configuration_files','3_configuration_files_for_tcoffee_{id}.log')
shell:
'set +o pipefail;'
'head -1 {input}| sed "s/$/_tcoffee/" >{output};'
'tail -2 {input} >>{output};'
'echo -e "D: [10,20,50,100,150,200]" >>{output};'
'echo -e "S: [100,200,500,1000,2000,5000,10000]" >>{output};'
'echo -e "T: 50" >>{output};'
'echo -e "M: [tcoffee]" >>{output};'
'echo -e "O: 10" >>{output}'
This diff is collapsed.
Click to expand it.
src/__pycache__/tool_consensus.cpython-37.pyc
deleted
100644 → 0
+
0
−
0
View file @
745fc121
File deleted
This diff is collapsed.
Click to expand it.
src/config_conda.sh
deleted
100644 → 0
+
0
−
14
View file @
745fc121
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup
=
"
$(
'/home/coralie/LogicielLocal/anaconda3/bin/conda'
'shell.bash'
'hook'
2> /dev/null
)
"
if
[
$?
-eq
0
]
;
then
eval
"
$__conda_setup
"
else
if
[
-f
"/home/coralie/LogicielLocal/anaconda3/etc/profile.d/conda.sh"
]
;
then
.
"/home/coralie/LogicielLocal/anaconda3/etc/profile.d/conda.sh"
else
export
PATH
=
"/home/coralie/LogicielLocal/anaconda3/bin:
$PATH
"
fi
fi
unset
__conda_setup
# <<< conda initialize <<<
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment