Commit ce2ea34a authored by Celine Noirot's avatar Celine Noirot
Browse files

Compute contig bed from idxstat file

parent 57820b3e
......@@ -711,7 +711,6 @@ process rename_contigs_genes {
set replicateId, file("${replicateId}.annotated.faa") into prokka_renamed_faa_ch
set replicateId, file("${replicateId}.annotated.gff") into prokka_renamed_gff_ch, prokka_renamed_gff_ch2
set replicateId, file("${replicateId}_prot.len") into contigs_length_ch
set replicateId, file("${replicateId}_contig.bed") into contigs_bed_ch
when: ('04_structural_annot' in step || '05_alignment' in step || '06_func_annot' in step || '07_taxo_affi' in step || '08_binning' in step)
......@@ -720,7 +719,6 @@ process rename_contigs_genes {
grep "^gnl" ${assembly_file}/${replicateId}.gff > ${replicateId}_only_gnl.gff
Rename_contigs_and_genes.py -f ${replicateId}_only_gnl.gff -faa ${assembly_file}/${replicateId}.faa -ffn ${assembly_file}/${replicateId}.ffn -fna ${assembly_file}/${replicateId}.fna -p ${replicateId} -oGFF ${replicateId}.annotated.gff -oFAA ${replicateId}.annotated.faa -oFFN ${replicateId}.annotated.ffn -oFNA ${replicateId}.annotated.fna
samtools faidx ${replicateId}.annotated.faa; cut -f 1,2 ${replicateId}.annotated.faa.fai > ${replicateId}_prot.len
samtools faidx ${replicateId}.annotated.fna; awk 'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}' ${replicateId}.annotated.fna.fai > ${replicateId}_contig.bed
"""
}
prokka_renamed_faa_ch.into{prokka_renamed_faa_ch2; prokka_renamed_faa_ch4}
......@@ -738,6 +736,7 @@ process reads_alignment_on_contigs {
output:
set val(replicateId), file("${replicateId}.sort.bam"), file("${replicateId}.sort.bam.bai") into reads_assembly_ch, reads_assembly_ch_for_metabat2, reads_assembly_ch_for_depth
set val(replicateId), file("${replicateId}.sort.bam.idxstats") into idxstats_ch
set val(replicateId), file("${replicateId}_contig.bed") into contigs_bed_ch
when: ('05_alignment' in step || '06_func_annot' in step || '07_taxo_affi' in step || '08_binning' in step)
......@@ -747,6 +746,7 @@ process reads_alignment_on_contigs {
bwa mem ${fna_prokka} ${deduplicated_reads_R1} ${deduplicated_reads_R2} | samtools view -bS - | samtools sort - -o ${replicateId}.sort.bam
samtools index ${replicateId}.sort.bam
samtools idxstats ${replicateId}.sort.bam > ${replicateId}.sort.bam.idxstats
awk 'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}' ${replicateId}.sort.bam.idxstats > ${replicateId}_contig.bed
"""
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment