my pattern is
Forward primer
CGAAGCCTGGGGTGCCCGCGATTT Plus 24 1 24 71.81 66.67 4.00 2.00
Reverse primer
AAATCGGTCCCATCACCTTCTTAT Minus 24 420 397 59.83 41.67 5.00 2.00
Product length
420
Products on potentially unintended templates
>CP049108.1 Mycobacterium tuberculosis strain 5005 chromosome, complete genome product length = 495
Forward primer 1 CGAAGCCTGGGGTGCCCGCGATTT 24
Template 1930054 ........................ 1930077
Reverse primer 1 AAATCGGTCCCATCACCTTCTTAT 24
Template 1930548 ........................ 1930525
product length = 2946
Forward primer 1 CGAAGCCTGGGGTGCCCGCGATTT 24
Template 1927603 .......C....C..T..T...G. 1927626
Reverse primer 1 AAATCGGTCCCATCACCTTCTTAT 24
Template 1930548 ........................ 1930525
>CP046728.2 Mycobacterium tuberculosis strain TCDC11 chromosome, complete genome product length = 420
Forward primer 1 CGAAGCCTGGGGTGCCCGCGATTT 24
Template 2150761 ........................ 2150784
Reverse primer 1 AAATCGGTCCCATCACCTTCTTAT 24
Template 2151180 ........................ 2151157
product length = 2595
Forward primer 1 CGAAGCCTGGGGTGCCCGCGATTT 24
Template 2148586 .......C....C..T..T...G. 2148609
Reverse primer 1 AAATCGGTCCCATCACCTTCTTAT 24
Template 2151180 ........................ 2151157
>CP047258.1 Mycobacterium tuberculosis strain TCDC3 chromosome product length = 345
Forward primer 1 CGAAGCCTGGGGTGCCCGCGATTT 24
Template 2166300 ........................ 2166323
Reverse primer 1 AAATCGGTCCCATCACCTTCTTAT 24
Template 2166644 ........................ 2166621
What I need is
>CP049108.1 = 495 1930054 1930548
>CP046728.2 = 420 2150761 2151180
>CP047258.1 = 345 2166300 2166644
I am microbiologist and Python beginner. I tried
import re
file = open(r"C:\\Users\\Lab\\Desktop\\amplicons\\ETRA", "r")
handle = file.read()
file.close()
pattern1 = re.compile(r'>.{5,10}\.\d')
matches1 = pattern1.finditer(handle)
for match1 in matches1:
print(match1.group(0))
but I need specific terms coming after my accession number too (accession number is >CP049108.1 for an example). I will adapt your knowledge to my other work too.
appreciate your help and thank you in advance