Skip to content

Commit 0694f1d

Browse files
committed
fixed bug in reference_assembly
1 parent 058b2b1 commit 0694f1d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

recipe/install_secapr_env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ conda install -y biopython
1414
conda install -y fastqc
1515
conda install -y fastp=0.23
1616
conda install -y spades=3.15.2
17-
conda install -y cons
1817
conda install -y blast
1918
conda install -y mafft
2019
conda install -y muscle

recipe/meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ requirements:
2929
- fastqc
3030
- fastp=0.23
3131
- spades=3.15.2
32-
- cons
3332
- blast
3433
- mafft
3534
- muscle

secapr/reference_assembly.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ def create_sample_reference_fasta(reference_folder,sample_id,alignments):
190190
return reference
191191

192192

193-
def mapping_bwa(subfolder_path,reference,sample_id,sample_output_folder, args):
194-
log = os.path.join(sample_output_folder, 'log')
193+
def mapping_bwa(subfolder_path,reference,sample_id,sample_output_folder, args, log):
195194
if not os.path.exists(log):
196195
os.makedirs(log)
197196
#Indexing
@@ -267,6 +266,7 @@ def mapping_bwa(subfolder_path,reference,sample_id,sample_output_folder, args):
267266
final_sam_name]
268267
command_merge += samfiles
269268
sp3 = subprocess.Popen(command_merge, stderr=subprocess.PIPE)
269+
sp3.wait()
270270
else:
271271
final_sam_name = samfiles[0]
272272

@@ -813,6 +813,7 @@ def main(args):
813813
reference = create_sample_reference_fasta(reference_folder,sample_id,alignments)
814814
# Safe the sample specific reference as a pickle file for downstream processing
815815
sample_output_folder = "%s/%s_remapped" %(out_dir,sample_id)
816+
log = os.path.join(sample_output_folder, 'log')
816817
sample_out_list.append(sample_output_folder)
817818
if not os.path.exists(sample_output_folder):
818819
os.makedirs(sample_output_folder)
@@ -822,7 +823,7 @@ def main(args):
822823
pickle_path = os.path.join(tmp_folder,'%s_reference.txt' %sample_id)
823824
np.savetxt(pickle_path,np.array([reference]),fmt='%s')
824825

825-
sorted_bam = mapping_bwa(subfolder_path,reference,sample_id,sample_output_folder,args)
826+
sorted_bam = mapping_bwa(subfolder_path,reference,sample_id,sample_output_folder,args,log)
826827

827828
if not args.keep_duplicates:
828829
sorted_bam, dupl_bam = clean_with_samtools(sample_output_folder,sample_id,sorted_bam,log)

0 commit comments

Comments
 (0)