Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. acc_number taxi
  2. YP_001378452 2345
  3. YP_001650052 5678
  4. YP_009446812 5435
  5. YP_002192894 7890
  6.  
  7. Nothing cluster species target score
  8. 7101 cluster_000001 species1 YP_001378452.1 31.7
  9. 50457 cluster_000001 species2 YP_001650052.1 27.9
  10. 48798 cluster_000001 species3 YP_002192894.1 34.5
  11. 8514 cluster_000001 species4 YP_009446812.1 28.9
  12.  
  13. TAXID=pd.read_table("/pathtoTAXID.txt",header=0)
  14. blast=pd.read_table("/pathtoblast.txt",header=0)
  15.  
  16.  
  17. for i in blast["target"]:
  18. if i in TAXID["acc_number"] without .1:
  19. add TAXID[taxi] in the line of the blast
  20.  
  21. for i in blast["target"]:
  22. print(TAXID.loc[TAXID["Acc_number"] == i.split('.')[0]][1])
  23.  
  24. df2['taxi']=df2.target.str.split(".").str[0].map(dict(zip(df1.acc_number,df1.taxi)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement