Closed:Running a hisat2 loop, samtools view and sort using python
1
0
Entering edit mode
3.6 years ago

Hi all,

I am running a large RNA seq dataset and have the trimmed reads ready for alignment through hisat2. If I try and run more than one alignment at a time, then my computer will not really operate because of the strain from the function. I am newer to python and am not quite sure on how to access functions like that through it, but here is what I have so far, yet its not quite working.

import os
import glob 
for file in folder:
     if '*forward.fastq.gz' == 'reverse.fastq.gz':
       file1 ='*forward.fastq.gz'
       file2 = '*reverse.fastq.gz'
       out = file1.replace('-forward.fastq.gz', '_sorted.bam')
       os.popen('/path/to/hisat2/hisat2 -p 20  -t --fr --dta-cufflinks -x hg38_index -1 %s -2 %s | /path/to/samtools view -b | /path/to/samtools sort -o %s' %(file1, file2, out))

Thanks so much

RNA-Seq rna-seq python hisat2 samtools • 312 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 3180 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6