Advertisement
cdocpalao

pyMUSA_LKMPalao

May 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Mon Oct 1 16:00:46 2018
  5.  
  6. @author: lkpalao
  7. """
  8.  
  9. import pandas as pd
  10. import os
  11.  
  12. os.chdir("/Users/beatrizpalao/Documents/dna_seq/db")
  13.  
  14. #input files
  15. resultsFile_ = "Abuabcontigs.csv"
  16. musaFile_ = "MusaFunSSRmarker.csv"
  17.  
  18. resultsFile = pd.read_csv(resultsFile_, header = 0, encoding = "ISO-8859-1")
  19. resRev_df = resultsFile["REVERSE PRIMER (5'-3')"]
  20. resFor_df = resultsFile["FORWARD PRIMER (5'-3')"]
  21. resMerge = "R_" + resRev_df + "_F_" + resFor_df
  22.  
  23. musaFile = pd.read_csv(musaFile_, header = 0, encoding = "ISO-8859-1")
  24. musaRev_df = musaFile["R Primer (5'-3')"]
  25. musaFor_df = musaFile["F Primer (5'-3')"]
  26. musaMerge = "R_" + musaRev_df + "_F_" + musaFor_df
  27.  
  28. index = []
  29. for i in resMerge:
  30. ind = 0
  31. for j in musaMerge:
  32. if i == j:
  33. print("res: %s, musa: %s" %(i,j))
  34. if ind != index:
  35. index.append(ind)
  36. ind += 1
  37.  
  38. # former ix
  39. seqid_match = musaFile.iloc[index]
  40.  
  41. #save file
  42. fname = resultsFile_.split(".")[0] + "_match.csv"
  43. seqid_match.to_csv(fname)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement