Python Forum

Full Version: basic question????????
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, I just could not figure out why this one does not work under jupyter notebook.
I tried to take the *.sam files, use the tool on the files and put the output bam file into bam folder.


%pylab inline 
import glob
import os as os
import pandas as pd
import numpy as np
if not os.path.exists('./bam'):
        os.makedirs('./bam') 
filelist=glob.glob('./sam/*.sam')
for i in filelist:  
    sample=i.split('/')
    sample=sample[2]
    sample_s=sample.split('.') 
    file_in='view -S -b ./sam/%s > \
    ./bam/%s.bam' %(sample,i,sample_s[0])
! samtools $file_in
(Jan-18-2019, 12:05 AM)metulburr Wrote: [ -> ]what does not work?
https://python-forum.io/misc.php?action=help&hid=19
out of range, ur index from 0 to 2