I am trying to look for miRNA targets using a file called Conservedfamily.txt
from the Zebrafish target scan fish website. I have written a python program to extract each of the miRNAs which works fine. However, for a big list of microRNAs, I must provide a name every time in line 22 and get one individual output file. I am thinking is there any option to parallelize the process so that somehow, I can provide a list of all microRNAs and obtain all my targets at the same time. The python code is attached below. I have posted the question in biostars but go no reply from them for 4 days. Hence I am posting the question in Stack exchange. The python code is attached below.
#!/usr/bin/python
#Import relevant modules
import sys
conservedfamily = open(sys.argv[1], 'r')
targetgenelist = open(sys.argv[2], 'w')
targetgeneid = open(sys.argv[3], 'w')
geneid = []
targetgenelist.write('miR family' + '\t' + 'Gene ID' + '\t' + 'Gene Symbol' + '\t' + 'Transcript ID' + '\t' + 'Species ID' + '\t' + 'UTR start' + '\t' + 'UTR end' + '\t' + 'MSA start' + '\t' + 'MSA end' + '\t' + 'Seed match' + '\n')
for line in conservedfamily:
splitline = line.strip().split('\t')
if splitline[0] == 'miR-210':
targetgenelist.write(line)
if not splitline[1] in geneid:
geneid.append(splitline[1])
targetgeneid.write(splitline[1] + '\n')
conservedfamily.close()
targetgenelist.close()
targetgeneid.close()
python miR99target.py 'Conserved_Family_Info.txt' 'miR-210targetlist.txt' 'miR-210targetid.txt'