Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. import sys
  2. from Bio import SeqIO
  3. from Bio.SeqRecord import SeqRecord
  4.  
  5. przeznaczenie_skryptu = """
  6.    1 opis/przeznaczenie skryptu
  7. """
  8.  
  9. autor = 'Anna Gabryanczyk'
  10. rok = 'Rok przygotowania: 2018'
  11.  
  12. print(przeznaczenie_skryptu)
  13. print(autor)
  14. print(rok)
  15.  
  16. insert_position = int(sys.argv[1])
  17. insert_nucleotide = sys.argv[2]
  18.  
  19. sequence_file = SeqIO.parse("seq1.fasta", "fasta")
  20. sequence = ''
  21.  
  22. print(sequence_file, 'length is', len(sequence_file))
  23.  
  24. if insert_nucleotide not in ['a', 'c', 'g', 't']:
  25.     print('zły rodzaj nukleotydu. Wybierz z listy [a, c, g, t]')
  26.     sys.exit(3)
  27.  
  28. if len(sequence_file) > 99:
  29.     print('za dluga sekwencja')
  30.     sys.exit(1)
  31.  
  32. if len(sequence_file) < 1:
  33.     print('za krótka sekwencja')
  34.     sys.exit(2)
  35.  
  36. for s in sequence_file:
  37.     sequence = s.seq
  38.     break
  39.  
  40. result_sequence = sequence[0:insert_position] + insert_nucleotide + sequence[insert_position:]
  41. sequence_rectord = SeqRecord(result_sequence, id="gi", description="Przetworzone juz")
  42. SeqIO.write(sequence_rectord, "result.faa", "fasta")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement