File: get_single_strand.py

package info (click to toggle)
hinge 0.5.0-8
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,972 kB
  • sloc: cpp: 9,480; ansic: 8,826; python: 5,023; sh: 340; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 374 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python3

#usage python3 get_single_strand.py <in-fasta> <out-fasta>

from pbcore.io import FastaIO
import sys

flpath = sys.argv[1]
outpath = sys.argv[2]
writer = FastaIO.FastaWriter(outpath)
reader = FastaIO.FastaReader(flpath)
j = 0
for i,record in enumerate(reader):
    if j%2 == 0:
        writer.writeRecord('Consensus'+str(j), record.sequence)
        j+=1