所以我试图解析一个 FastQ 序列,但我是 Python 的初学者,我对我的代码为什么不起作用感到有点困惑。这是程序应该执行的操作:
如果我输入 FASTQ seqname 行...
@EAS139:136:FC706VJ:2:2104:15343:197393
...那么程序应该输出:
Instrument = EAS139
Run ID = 136
Flow Cell ID = FC706VJ
Flow Cell Lane = 2
Tile Number = 2104
X-coord = 15343
Y-coord = 197393
到目前为止,这是我未完成的代码:
class fastq:
def __init__(self,str):
self.str = inStr.replace ('@',' ').split (':')
def lists (self,parameters):
self.parameters = ("Instrument","Run ID","Flow Cell ID","Flow Cell Lane","Tile Number","X-coordinates","y-coordinates")
def zip (self,myZip,zippedTuple):
self.Zip = zip(self.parameters,self.transform)
self.zippedTuple = tuple(myZip)
print (tuple(myZip))
def main():
seq = input('Enter FastQ sequence:')
new_fastq = fastq(str)
new_fastq.lists()
new_fastq.zip()
main()