SHARE
TWEET

Untitled

a guest Jul 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. seq1
  2. ACTGTGTGTGTACAGTGCA
  3. seq2
  4. ACTGTGTGTGTACGT
  5. seq3
  6. ACAACACGTGTGTTTTTTT
  7.      
  8. file1 = open(sys.argv[1], "r")
  9.  
  10. counter = 0
  11. for line in file1:
  12.     counter = counter + 1  
  13.     line = line.strip("n")
  14.     if counter%2 != 0:
  15.         print(">"+line)
  16.     else:
  17.         print(line)
  18.  
  19. file1.close()
  20.      
  21. counter = 0
  22. for line in file1:
  23.     counter = counter + 1  
  24.     if counter%2 != 0:
  25.         print(">", end="")
  26.     print(line.strip("n"))
  27.      
  28. with open('file1.txt') as f:
  29.     for i,v in enumerate(f,1):
  30.         if i%2!=0:
  31.             print(v) # add '>' like ('>'+v)
  32.      
  33. seq1
  34.  
  35. seq2
  36.  
  37. seq3
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top