I am trying to look for miRNA targets using a file called Conservedfamily.txt from the Zebrafish target scan fish website. I have a python program written 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 way 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
#!/usr/bin/python #Import relevant modules import sys conservedfamily = open(sys.argv, 'r') targetgenelist = open(sys.argv, 'w') targetgeneid = open(sys.argv, '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 == 'miR-210': targetgenelist.write(line) if not splitline in geneid: geneid.append(splitline) targetgeneid.write(splitline + '\n') conservedfamily.close() targetgenelist.close() targetgeneid.close()
python miR99target.py 'Conserved_Family_Info.txt' 'miR-210targetlist.txt' 'miR-210targetid.txt'