Question
Write a python script that takes two files on the command line, in this order: ( PYTHON) (1) aGenBankfilecontainingonegenomerecord (2) a FASTQ file containing several
Write a python script that takes two files on the command line, in this order: (PYTHON)
(1) aGenBankfilecontainingonegenomerecord (2) a FASTQ file containing several read records.
Your script should map the read sequences to the reference genome, finding the indices of the start and end nucleotides of the genome that correspond to each read sequence. Reads may map to one, several, or no locations in the genome.Reads may map to the forward strand and/or the reverse complement strand of the genomic sequence. The forward strand of the genomic sequence is the one found in the genbank file.
The script should output an aligned table with a header row, with one line per read in the FASTQ file. Report four columns: (1) read id, (2) the match state, (3) the start index of the read within the genome, and (4) the end index of the read within the genome. The match state should be match if the read is found exactly once in the genome, no match if the read is not found in the genome, and ambiguous if multiple matches are found. Only report the start and end nucleotides if a read matches the genome exactly once.
Example output is shown below for one genbank file and one FASTQ file.
$ python hw_w14.py ecoli_genes.gb ecoli_reads_set1.fastq
id read07678 read14482 read17896 read19638 read19786 read22019
state
start 3737329
5226811 4989722
2755786 4471194 28815
4075567 4182125
5027408 4067391
end 3737341
5226824 4989738
2755796 4471211 28830
4075581 4182138
5027424 4067406
match no match no match match match no match read33772 ambiguous read34098 no match read42251 ambiguous
read46374 read67631 read68830 read69189 read78255 read83652 read87703 read87783 read91287 read92472 read93774
match match match
no match no match match match no match no match match match
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started