Finding non ATGCN sequences using python
1
0
Entering edit mode
2.2 years ago
AveryB • 0

I want to search for non sequences in a file, to substitute them.

for file in SeqIO.parse('myfile.fasta', 'r'):
    sequence = re.search('^ATGCN', record.seq)
    output_file=open('files.fasta, 'w+')
python Fasta sequence • 650 views
ADD COMMENT
1
Entering edit mode
2.2 years ago

Go to a site like:

https://regex101.com/

to test your regular expressions (select Python as the language). To match characters except ATGCN the pattern would be:

[^ACGTN]

you get quite helpful tips in the sidebar

ADD COMMENT

Login before adding your answer.

Traffic: 1547 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6