Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Created on Mon Oct 1 16:00:46 2018
- @author: lkpalao
- """
- import pandas as pd
- import os
- os.chdir("/Users/beatrizpalao/Documents/dna_seq/db")
- #input files
- resultsFile_ = "Abuabcontigs.csv"
- musaFile_ = "MusaFunSSRmarker.csv"
- resultsFile = pd.read_csv(resultsFile_, header = 0, encoding = "ISO-8859-1")
- resRev_df = resultsFile["REVERSE PRIMER (5'-3')"]
- resFor_df = resultsFile["FORWARD PRIMER (5'-3')"]
- resMerge = "R_" + resRev_df + "_F_" + resFor_df
- musaFile = pd.read_csv(musaFile_, header = 0, encoding = "ISO-8859-1")
- musaRev_df = musaFile["R Primer (5'-3')"]
- musaFor_df = musaFile["F Primer (5'-3')"]
- musaMerge = "R_" + musaRev_df + "_F_" + musaFor_df
- index = []
- for i in resMerge:
- ind = 0
- for j in musaMerge:
- if i == j:
- print("res: %s, musa: %s" %(i,j))
- if ind != index:
- index.append(ind)
- ind += 1
- # former ix
- seqid_match = musaFile.iloc[index]
- #save file
- fname = resultsFile_.split(".")[0] + "_match.csv"
- seqid_match.to_csv(fname)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement