forked from BMI203-2022/project1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
executable file
·48 lines (36 loc) · 1.27 KB
/
example.py
File metadata and controls
executable file
·48 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from seqparser import (
FastaParser,
FastqParser,
transcribe,
reverse_transcribe)
def main():
"""
The main function
"""
# Create instance of FastaParser and FastqParser
aparser = FastaParser('data/test.fa')
qparser = FastqParser('data/test.fq')
# For each record of FastaParser, Transcribe the sequence
# and print it to console
#for i, (seq, line) in enumerate(aparser):
# print(i, seq, line)
# For each record of FastqParser, Transcribe the sequence
# and print it to console
for i, (seq, line, quality) in enumerate(qparser):
print(i, seq, line)
# For each record of FastaParser, Reverse Transcribe the sequence
# and print it to console
#for line in aparser:
# print(transcribe(line[1]))
# For each record of FastqParser, Reverse Transcribe the sequence
# and print it to console
#for line in qparser:
# print(reverse_transcribe(line[1]))
"""
When executing a python script from the command line there will
always be a hidden variable `__name__` set to the value `__main__`.
Since this is guaranteed you can execute your `main` function with
the following if statement
"""
if __name__ == "__main__":
main()