Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from Bio import SeqIO
- from Bio.SeqRecord import SeqRecord
- przeznaczenie_skryptu = """
- 1 opis/przeznaczenie skryptu
- """
- autor = 'Anna Gabryanczyk'
- rok = 'Rok przygotowania: 2018'
- print(przeznaczenie_skryptu)
- print(autor)
- print(rok)
- insert_position = int(sys.argv[1])
- insert_nucleotide = sys.argv[2]
- sequence_file = SeqIO.parse("seq1.fasta", "fasta")
- sequence = ''
- print(sequence_file, 'length is', len(sequence_file))
- if insert_nucleotide not in ['a', 'c', 'g', 't']:
- print('zły rodzaj nukleotydu. Wybierz z listy [a, c, g, t]')
- sys.exit(3)
- if len(sequence_file) > 99:
- print('za dluga sekwencja')
- sys.exit(1)
- if len(sequence_file) < 1:
- print('za krótka sekwencja')
- sys.exit(2)
- for s in sequence_file:
- sequence = s.seq
- break
- result_sequence = sequence[0:insert_position] + insert_nucleotide + sequence[insert_position:]
- sequence_rectord = SeqRecord(result_sequence, id="gi", description="Przetworzone juz")
- SeqIO.write(sequence_rectord, "result.faa", "fasta")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement