Skip to content

Commit

Permalink
rename log file
Browse files Browse the repository at this point in the history
  • Loading branch information
fei0810 committed Apr 7, 2021
1 parent 927cb40 commit b718b01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tritimap/rules/denovo_sacffold_filter_by_fasta.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rule uniqScaffoldByFasta:
message: "\nGet bulk uniq scaffolds by fasta file. Input file: {input.fa}\n"
threads: thread
log:
join(dir_path+"/logs", "_".join(samples.bulk.drop_duplicates()) + "_uniqscaffold.log")
join(dir_path+"/logs", "_".join(samples.bulk.drop_duplicates()) + "_uniqscaffold_byfasta.log")
shell:"""
set +e
bash {params.scriptdir}/getuniqscaffold_by_fasta.sh {input.fa} {params.database} {params.length} {params.genome} {threads} {params.datatype} {params.memory} {output.scaffold1} {output.scaffold2} {output.unmap1} {output.unmap2} > {log} 2>&1
Expand Down
2 changes: 1 addition & 1 deletion tritimap/rules/denovo_scaffold_filter_by_region.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rule uniqScaffoldByRegion:
message: "\nGet uniq scaffolds by region file. Input file: {input.fa}\n"
threads: thread
log:
join(dir_path+"/logs", "_".join(samples.bulk.drop_duplicates()) + "_uniqscaffold.log")
join(dir_path+"/logs", "_".join(samples.bulk.drop_duplicates()) + "_uniqscaffold_byregion.log")
shell:"""
set +e
cat {input.region} | tr ',' '\t' | awk '{{print $1"\tqtl\t"$2"\t"$3}}' > {output.region}
Expand Down
17 changes: 11 additions & 6 deletions tritimap/rules/dna_mapping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ rule dnaBWAmem2Mapping:
errormap = dir_path+"/03_mappingout/{bulk}_{bulktype}.errormap.sort.bam",
unmap = dir_path+"/03_mappingout/{bulk}_{bulktype}.unmap.bam"
threads: thread
log:
dir_path+"/logs/{bulk}_{bulktype}_bwamem2.log"
message: "Mapping {input} with BWA-mem2"
run:
shell("""
bwa-mem2 mem -v 1 -t {threads} -M -Y -R '{params.group}' {params.genome} {input} | \
samtools sort -@ {threads} -o {output.raw} - ;
samtools view -h -f 3 {output.raw} | egrep -v 'XA:Z|SA:Z' | samtools sort -@ {threads} -o {output.truemap} ;
samtools view -h {output.raw} | egrep '^@|XA:Z|SA:Z' | samtools sort -@ {threads} -o {output.errormap} ;
samtools sort -@ {threads} -o {output.raw} -;
echo "raw.down" ;
samtools view -h -f 3 {output.raw} | egrep -v 'XA:Z|SA:Z' | samtools sort -@ {threads} -o {output.truemap} -;
echo "true.down" ;
samtools view -h {output.raw} | egrep '^@|XA:Z|SA:Z' | samtools sort -@ {threads} -o {output.errormap} -;
echo "error.down" ;
samtools view -f 4 -b {output.raw} > {output.unmap} ;
samtools index -c {output.raw};
samtools index -c {output.truemap};
samtools index -c {output.errormap};
samtools index -c {output.raw} ;
samtools index -c {output.truemap} ;
samtools index -c {output.errormap}
""")

0 comments on commit b718b01

Please sign in to comment.