I would like to solve my problem, which is:
When conditions are met for my line, print out all lines starting from this line up until this line + value
I have a code looking like this:
import re
##
def round_down(num):
return num - (num%100000) ###reduce search space
##
##
##def Filter(infile, outfile):
##out = open(outfile,'w')
infile = open('AT_rich','r')
cov = open('30x_good_ok_bad_0COV','r') ###File with non platinum regions
#platinum_region = [row for row in Pt]
platinum_region={} ### create dictionary for non platinum regions. Works fast
platinum_region['chrM']={}
platinum_region['chrM'][0]=[]
ct=0
for region in infile:
(chr,start,end,types,length)= region.strip().split()
start=int(start)
end=int(end)
length = int(length)
rounded_start=round_down(start)
##
if not (chr in platinum_region):
platinum_region[chr]={}
if not (rounded_start in platinum_region[chr]):
platinum_region[chr][rounded_start]=[]
platinum_region[chr][rounded_start].append({'start':start,'end':end,'length':length})
##
##c=0
for vcf_line in cov: ###process file with indels
## if (c % 1000 ==0):print "c ",c
## c=c+1
vcf_data = vcf_line.strip().split()
vcf_chrom=vcf_data[0]
vcf_pos=int(vcf_data[1])
vcf_end=int(vcf_data[2])
coverage = int(vcf_data[3])
rounded_vcf_position=round_down(vcf_pos) ###round positions to reduce search space
## print vcf_chrom
## for vcf_line in infile: ###process file with indels
## if (c % 1000 ==0):print "c ",c
overlapping = 'false'
if vcf_chrom in platinum_region and rounded_vcf_position in platinum_region[vcf_chrom]:
for region in platinum_region[vcf_chrom][rounded_vcf_position]:
if (vcf_pos == region['start']):# and vcf_end == region['end']):# and (vcf_end > region['start'] and vcf_end < region['end']):
if vcf_chrom != 'chrX' and vcf_chrom != 'chrY':
print vcf_data
Files are just set of intervals start-end, first column[0] conatins chromosome ex.'chr1':
cov:
chr1 1 3 AT_rich 3
chr1 5 8 AT_rich 4
chr1 10 12 AT_rich 3
last column is the region['length']
infile:
chr1 1 2 4247
chr1 2 3 4244
chr1 3 5 4224
chr1 5 7 4251
chr1 7 8 4251
chr1 8 12 4254
chr1 12 15 4253
output would be:
chr1 1 2 4247
chr1 2 3 4244
chr1 5 7 4251
chr1 7 8 4251
chr1 8 12 4254## here there isn't really start-start matching position, but there is an overlap between two files
chr1 12 15 4253
so the main idea is, if region from one file(cov) starts at the position of the region from second file(infile). Print all positions starting from this matching start position up until the length of the region from first file(cov). Sometimes there is not exact matching position, just some overlap, so in this case we can probably not care about those (even though it would be nice to also have them in output)
I would like to print lines starting from vcf_data(when conditions met) until vcf_data + region['length']. What is the way to add this to my code?
Add this condition to the loop:
if region_count > 0:
region_count -= 1
print line
Before the loop:
region_count = 0
And inside the "condition was met" but before the new condition block above:
region_count = region['length']
I don't quite get your input and output format, but from your description, I guess you can do something like this:
lines = string.split('\n') # Put the content into array of lines
for idx, line in enumerate(lines): # Iterate over the lines, with the index
if condition(line): # If the line fulfill a condition
print lines[idx:idx+length] # Print the line range
Related
I have a program which converts a simple image (black lines on white background) into 2 character ASCII art ("x" is black and "-" is white).
I want to read each line and print the number or same character in a row at the end of each line. Do you know how I can do this?
for example:
---x--- 3 1 3
--xxx-- 2 3 2
-xxxxx- 1 5 1
in the top row there are 3 dashes 1 'x' and 3 dashes, and so on.
I would like these numbers to be saved to the ASCII text document.
Thank you!
You can use itertools.groupby:
from itertools import groupby
with open("art.txt", 'r') as f:
for line in map(lambda l: l.strip(), f):
runs = [sum(1 for _ in g) for _, g in groupby(line)]
print(f"{line} {' '.join(map(str, runs))}")
# ---x--- 3 1 3
# --xxx-- 2 3 2
# -xxxxx- 1 5 1
I have a problem during the reading of a text file in python. Basically what I need is to get the 4th column in a list.
With this small function I achieve it without any great issues:
def load_file(filename):
f = open(filename, 'r')
# skip the first useless row
line = list(f.readlines()[1:])
total_sp = []
for i in line:
t = i.strip().split()
total_sp.append(int(t[4]))
return total_sp
but now I have to manage files, that in the last row(s) have any random number that don't respect the text format. An example of the not working text file is:
#generated file
well10_1 3 18 6 1 2 -0.01158 0.01842 142
well5_1 1 14 6 1 2 0.009474 0.01842 141
well4_1 1 13 4 1 2 -0.01842 -0.03737 125
well7_1 3 10 1 1 2 -0.002632 0.009005 101
well3_1 1 10 9 1 2 -0.03579 -0.06368 157
well8_1 3 10 10 1 2 -0.06895 -0.1021 158
well9_1 3 10 18 1 2 0.03053 0.02158 176
well2_1 1 4 4 1 2 -0.03737 -0.03737 128
well6_1 3 4 5 1 2 -0.07053 -0.1421 127
well1_1 -2 3 1 1 2 0.006663 -0.02415 128
1 0.9259
2 0.07407
where 1 0.9259 and 2 0.07407 have to be dumped.
In fact, using the function of above with this text file, I get the following error because of the 2 additional last rows:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/tmp/tmpqi8Ktw.py", line 21, in load_obh
total_sp.append(int(t[4]))
IndexError: list index out of range
How can I get rid of the last lines in the line variable?
Thanks to all
There are many ways to handle this, one such way can be to handle the indexError by surrounding the erroneous code by try and except, something like this :
try :
total_sp.append(int(t[4]))
except IndexError :
pass
This will only append to the total_sp when index exits otherwise not. Also, this will handle whenever you do not have the data present corresponding to that particular index.
Alternatively, if you are interested in removing just the last two rows (elements), you can use the slice operator such as by replacing line = list(f.readlines()[1:]) with line = f.readlines()[1:-2].
f.readlines already returns a list. Just as you provide a start index to slice from, you can specify "2 before the end" using negative indexing as below:
line = f.readlines()[1:-2]
Should do the trick.
EDIT: To handle an arbitrary number of lines at the end:
def load_file(filename):
f = open(filename, 'r')
# skip the first useless row
line = f.readlines()[1:]
total_sp = []
for i in line:
t = i.strip().split()
# check if enough columns were found
if len(t) >= 5:
total_sp.append(int(t[4]))
return total_sp
Also there is a "your case-specific" solution:
for i in line:
if not i.startswith(' '):
t = i.strip().split()
total_sp.append(int(t[4]))
I have a bunch of files from a LAMMPS simulation made by a 9-lines header and a Nx5 data array (N is large, order 10000). A file looks like this:
ITEM: TIMESTEP
1700000
ITEM: NUMBER OF ATOMS
40900
ITEM: BOX BOUNDS pp pp pp
0 59.39
0 59.39
0 59.39
ITEM: ATOMS id type xu yu zu
1 1 -68.737755560980844 1.190046376093027 122.754819323806714
2 1 -68.334493269859621 0.365731265115530 122.943111038981527
3 1 -68.413018326512173 -0.456802254452782 123.436843456292138
4 1 -68.821350328206080 -1.360098170077123 123.314784135612115
5 1 -67.876948635447775 -1.533699833382506 123.072964235308660
6 1 -67.062910322675322 -2.006415676993953 123.431518511867381
7 1 -67.069984116148134 -2.899068427170739 123.057125785834685
8 1 -66.207325578729183 -3.292545155979909 123.377770523297343
...
I would like to open every file, perform a certain operation on the numerical data and save the file with a different name leaving the header unchanged. My script is:
for f in files:
filename=path+"/"+f
with open(filename) as myfile:
header = ' '.join([next(myfile) for x in xrange(9)])
data=np.loadtxt(filename,skiprows=9)
data[:,2:5]%=L #Put everything inside the box...
savetxt(filename.replace("lammpstrj","fold.lammpstrj"),data,header=header,comments="",fmt="%d %d %.15f %.15f %.15f")
The output, though, looks like this:
ITEM: TIMESTEP
1700000
ITEM: NUMBER OF ATOMS
40900
ITEM: BOX BOUNDS pp pp pp
0 59.39
0 59.39
0 59.39
ITEM: ATOMS id type xu yu zu
1 1 50.042244439019157 1.190046376093027 3.974819323806713
2 1 50.445506730140380 0.365731265115530 4.163111038981526
3 1 50.366981673487828 58.933197745547218 4.656843456292137
4 1 49.958649671793921 58.029901829922878 4.534784135612114
5 1 50.903051364552226 57.856300166617494 4.292964235308659
6 1 51.717089677324680 57.383584323006048 4.651518511867380
7 1 51.710015883851867 56.490931572829261 4.277125785834684
8 1 52.572674421270818 56.097454844020092 4.597770523297342
...
The header is not exactly the same: there are spaces at the beginning of every lines except for the first, and a newline after the last line of the header. I need to get rid of those, but I don't know how.
What am I doing wrong?
The issue is in the ' '.join(a):
a = ['sadf\n', 'sdfg\n']
' '.join(a)
>>>'sadf\n sdfg\n' # Note the space at the start of the second line.
Instead:
''.join(a)
>>>'sadf\nsdfg\n'
You will also need to trim the last '\n' in your header to prevent the empty line:
''.join(a).rstrip()
>>>'sadf\nsdfg'
The header parameter will add a newline after it automatically, so you can eliminate the original last '\n' as a redundant newline.
header = header.rstrip('\n')
The leading spaces occurs, since you join each line by an extra space character. you can solve it by the below command.
header = ''.join([next(myfile) for x in xrange(9)])
As self education day of the week I was playing around with parser utility in python.
I made some progress also, but I am stuck with a very silly problem.
The problem: I have an input file which has one only one column (and n number of rows) and I have m number of dictionary files. I want to extract the values of the terms (in my input file) from the different dictionaries.
Input file is:
SGIP1
SLC45A1
NECAP2
AGBL4
dictionary file 1
NM_032291 chr1 66999824 67210768 0 SGIP1 4694 6 1.0586e-02
NM_001080397 chr1 8384389 8404227 0 SLC45A1 2401 0 0.0000e+00
NM_018090 chr1 16767166 16786584 0 NECAP2 2081 3673 1.4617e+01
NM_032785 chr1 48998526 50489626 -0 AGBL4 2988 0 0.0000e+00
NM_001145278 chr1 16767166 16786584 0 NECAP2 2003 3534 1.4612e+01
NM_013943 chr1 25071759 25170815 0 CLIC4 4434 5646 1.0545e+01
NM_001145277 chr1 16767166 16786584 0 NECAP2 2005 3504 1.4473e+01
NM_052998 chr1 33546713 33585995 0 ADC 2182 4 1.5182e-02
NM_001195683 chr1 92145899 92351836 -0 TGFBR3 6464 59 7.5590e-02
dictionary file2
NM_032291 chr1 66999824 67210768 + SGIP1 4694 44 9.5755e-02
NM_001080397 chr1 8384389 8404227 + SLC45A1 2401 4 1.7018e-02
NM_018090 chr1 16767166 16786584 + NECAP2 2081 1815 8.9095e+00
NM_032785 chr1 48998526 50489626 - AGBL4 2988 4 1.3675e-02
NM_001145278 chr1 16767166 16786584 + NECAP2 2003 1760 8.9760e+00
NM_013943 chr1 25071759 25170815 + CLIC4 4434 3859 8.8906e+00
NM_001145277 chr1 16767166 16786584 + NECAP2 2005 1719 8.7581e+00
NM_052998 chr1 33546713 33585995 + ADC 2182 14 6.5543e-02
NM_001195683 chr1 92145899 92351836 - TGFBR3 6464 49 7.7436e-02
The dictionary files can be 1 or many depending upon the user and can have many rows.
If the value in column 6 of dictionary file matches the value in input file and value in column 8 of dictionary is more than 5. It should print column 6 and column 9 and assemble the result in one final file as:
SGIP1 1.0586e-02 9.5755e-02
NECAP2 1.4617e+01 8.9095e+00
NECAP2 1.4612e+01 8.9760e+00
This is the format I require.
What have I done:
#!/usr/bin/python
import sys
import re
import os
import tempfile
import subprocess
import math
from optparse import OptionParser,OptionGroup
VERSION = "1.0 "
########process the options##########
usage = "usage: %prog -l <FILE> -i <FILE>,<FILE>,<FILE>....... -n <STRING> "
parser = OptionParser()
parser.add_option("-l", "--genelist file", dest="input_file", help="one string per line", metavar="FILE")
parser.add_option("-i", "--RNASeq files (separted by comma)", dest="data_file", help="RNASeq file generated from Arjen's Script", metavar="FILE")
parser.add_option("-n", "--name", dest="name", help="Name of output file", metavar="STRING")
parser.add_option_group(group1)
(options, args) = parser.parse_args()
####check whether all files & scripts are present####
if not options.input_file or not options.name:
parser.print_help()
sys.exit(0)
####reading input file ######
for item in open(options.input_file):
item=item.replace("\n","")
#######reading of data file and matching the components and assembling in final file##########
This is where I am lost I dont know how to do it, the datafiles if more than 1 will be seperated by comma's.
I have done similar thing with quick and dirty solution for one data file, The code for which is below (incase needed)
#! /usr/bin/python
inputfile="genelist.txt"
rnafile="datafile.txt"
for item in open(inputfile):
item=item.replace("\n","")
for line in open(rnafile):
line = line.split("\t")
if line[5] == item:
print (line[5] + "\t" + line[8].replace("\n",""))
Could anyone of you please guide me.
Thank you
Ok, here is my untested code below. This should just about do what you are looking for, bar exception handling and some possible formatting issues:
# edit - have to remove trailing \n from input lines
valid_items = [ line.strip() for line in open('input') ]
with open('dictionary1') as dict1:
for dict2_line in open('dictionary2'):
dict1_line = dict1.readline()
# protect against dict1 being shorter
if dict1_line == '':
break
fields1 = dict1_line.split()
if fields1[5] in valid_items and int(fields1[7]) > 5:
fields2 = dict2_line.split()
print(fields1[5].ljust(8) + fields1[8] + ' ' + fields2[8])
Not that using split without arguments splits on any whitespace, doesn't produce empty fields and should remove the trailing newline. This is probably what you are looking for since the separators in your example aren't consistent.
Hope this helps!
I was trying to scan with positions from one file through positions in second file to find, if the features are overlaping between them.
I have a file Pt looking like this:
chr10 0 60985
chr10 60988 60990
chr1 165014865 165014867
chr1 1161693 1161695
chr1 158851689 158851689
chr10 64766 64767
chr10 63600 64703
chr11 647696 647697
And file a (it has of course many many lines like the one below):
chr1 1161693 chr1uGROUPERuDELu0u832 TGCTCTTTCCAGAAACCCTCAACCCTGTACGGTCAGGAGGAAACATGGCACCTCCCCTCTGGGG T 63 NormalSupport;MinSampleCount;LowSomaticScore CLUSTER_NUM=5454;CONTIG=GGTGCAGGGAAGCAGGAAGGAAGTGAAGCTCAAAAGCCCCTAGGACAGGGCACCTCCCCTCTGGATGCTCTTTCCAGAAACCCTCAACCTTGTACGGTCAGGAGAAAACACATCCCACAAG;CONTIG_NUM=5840;DOWNSTREAM=GCTCTTTCCAGAAACCCTCAACCCTGTACGGTCAGGAGAAAACACATCCCACAAG;END=1161756;NS=1;READSOURCES=(0:3:0,1:2:13);SOMATICSCORE=19;SVLEN=-63;SVTYPE=DEL;UPSTREAM=GGTGCAGGGAAGCGGGAAGGAAGTGAAGCTCAAAAGCCCCTAGGACAGGGCACCTCCCCTCTGGAT;ensembl_gene_id=ENSG00000078808 GT:GQ 1/.:.
chr1 158851689 chr1uGROUPERuDELu3u4452 GGGGAGTAATTCTTATTCATGATATGAAAACTCTAATGTGTTTCTTATTCCAGAAAA G 100 NormalSupport CLUSTER_NUM=25182;CONTIG=CATATTTTGCTATATCTCACATCATTGTTCATCTGATAATATATGAAAACTACAATGTGTTTCTTATTCCAGAAAGGGGAGTAATTCTTATTCATGAATAAACACTGAAGGAGAAAGATTATGGATCATAGTGGGAAAAGCCACAATACCATCTACATTC;CONTIG_NUM=24300;DOWNSTREAM=GGGAGTAATTCTTATTCATGAATAAACACTGACGGAGAAAGATTATGGATCATAGTGGGAAAAGCCACAATACCATCTACATTC;END=158851745;NS=1;READSOURCES=(0:11:0,1:3:18);SOMATICSCORE=55;SVLEN=-56;SVTYPE=DEL;UPSTREAM=CATATTTTGCTATATCTCACATCATTGTTCATCTGATAATATATGAAAACTCCAATGTGTTTCTTATTCCAGAAAG;ensembl_gene_id=ENSG00000229849 GT:GQ 1/.:.
chr1 165014865 chr1uGROUPERuDELu3u7344 ACTGGCATTAGCTATGCTTCCTTAGGCAGACAGCATGTTGAGAAATTCACATTCATCAG A 100 NormalSupport CLUSTER_NUM=40249;CONTIG=CTCCAGTAAAGAGCATCTTTTAATGAAGTGTATCTGCCTGGGCTAGAAAGGCAGCTGCCTCCACTAAAGCAGGGCTGGTCCAGAAATATTACCACTTGCCTAATCCTTATAGTAATCCTAACTGGCAGGTATTATTATATCCCAATTCACACACTTAGAGG;CONTIG_NUM=38845;DOWNSTREAM=CTTGCCTAATCCTTATAGTAATCCTAACTGGCAGGTATTATTATATCCCAATTCACACACTTAGAGG;END=165014923;NS=1;READSOURCES=(0:32:0,1:9:18);SOMATICSCORE=60;SVLEN=-58;SVTYPE=DEL;UPSTREAM=CTCCAGTAAAGAGCATCTTTTAATGAAGTGTATCTGCCTGGGCTAGAAAGGCAGCTGCCTCCACTAAAGCAGGGCTGGTCCAGAAATATTACCA GT:GQ 1/.:.
chr1 176569763 chr1uGROUPERuDELu3u12313 GATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAAAAAAAAAAAAAAAAAA G 100 NormalSupport;LowSomaticScore CLUSTER_NUM=65333;CONTIG=GCGTGGTAGCGGGCGCCTGTAGTCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATGGCGTGAACCCGGGAGGCGGAGCTTGCAGTGAGCCGAGATCACAGAGCTCAAGCTCACAATTCCATTATACTGTTACTC;CONTIG_NUM=62936;DOWNSTREAM=ATCACAGAGCTCAAGCTCACAATTCCATTATACTGTTACTC;END=176569833;NS=1;READSOURCES=(0:14:0,1:8:7);SOMATICSCORE=22;SVLEN=-70;SVTYPE=DEL;UPSTREAM=GCGTGGTAGCGGGCGCCTGTAGTCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATGGCGTGAACCCGGGAGGCGGAGCTTGCAGTGAGCCGAG;ensembl_gene_id=ENSG00000116183 GT:GQ 1/.:.
chr1 184683773 chr1uGROUPERuDELu3u15990 TAACAGTTTGGATGAAAAAAATGTAAGGTATGCTCATCTAAACTATAGATCATTGAAAACTGGTAGTTTAGCTAATGAGATTCAACCTCTAGACCAAAATCTAGAAACAAAACAAAAAAAGAAATTTTGCTGAGTTAAATATAAAAGTTCTAAGTTTACACTAAAAAAAAGAA T 93 PASS CLUSTER_NUM=82731;CONTIG=TAAACCACCACATGCAAAGAGCCTGTAACTGAAAGCTCTTGAGTGCAGTGCCACAAGGCACTGGTTGGGGTCCAACCAAAACTTCTTCCTAACTTGGCTGCTCAAAGGCAGGGTGGAGAACACTCATTTGTCAGCAGACCATAC;CONTIG_NUM=79822;DOWNSTREAM=AACTTGGCTGCTCAAAGGCAGGGTGGAGAACACTCATTTGTCAGCAGACCATAC;END=184683945;NS=1;READSOURCES=(0:12:46,1:0:44);SOMATICSCORE=30;SVLEN=-172;SVTYPE=DEL;UPSTREAM=TAAACCACCACATGCAAAGAGCCTGTAACTGAAAGCTCTTGAGTGCAGTGCCACAAGGCACTGGTTGGGGTCCAACCAAAACTTCTTCCT;ensembl_gene_id=ENSG00000116406 GT:GQ 1/.:.
chr1 193557238 chr1uGROUPERuDELu3u20250 TGTGTGTATACACACACACACATATATGTGTGTATACACACACACACATATATATATGTGTGTATACACACACACACATATATATGTGTGTATACACACAC T 100 NormalSupport CLUSTER_NUM=103112;CONTIG=TTTAAAATAAGGGGGGAAATTTATATATATATATATATATATATGTGTGTGTGTATACACACACACATATATATATATACACACACACATATATATATATATACACATACACACACACACACACACACACACACACACACACTGTTTGAAATA;CONTIG_NUM=99338;DOWNSTREAM=ACATATATATATATGTGTGTATACACACACACATATATATATATACACACACACATATATATATATACACATACACACACACACACACACACACACACACACACACACTGTTTGAAATA;END=193557338;NS=1;READSOURCES=(0:23:0,1:3:26);SOMATICSCORE=60;SVLEN=-100;SVTYPE=DEL;UPSTREAM=TTTAAAATAAGGGGGGAAATTTATATATATATAT GT:GQ 1/.:.
chr1 211021468 chr1uGROUPERuDELu4u5565 ACAAGCTGTTGGGTTATCTCTTTATGATCTTCAACTACACTAAGAAGTGTGTCAATTGTATTCAGAATTCCCATAGCAGTAACTGCTTTGTCATCACTACCTTCTTCATCTGGCCCTGTCTGGATTACTTGGCTAAATGTCATTGCCAACTGTTGTGTCATTTCTACTGCAATAGGAGTAACTTCTTCACTATTTTCACAGATCATTTTCTGAATTACATTGGTAAGGTCATCATTTTCTGTTTCTGTTATAATATGAAGAAGAGCCTGCATTACAGGTCTGATAAATGCTGTGATACATTCTTTAGATTTTTCTTGATTGCTGATAAATACTTGAAGGACAATGGCAGCTTCCACTTTCACAGGCATGTCTCTGTCATCAATCAGACATCTTCTTGTTAGCTCTAAAGCTGTTTGAATGTTCTGATCACTTTTGAACTTTACTTCACAAAAATAGTGAAGTACTCAGCAAGCCCTTGCTCTCATGTAGCCTAGTTCACTGCTGAAGAGAGAGAACACATGATTCTGCAACATGTATTCCATCTGATCATTACAGATCTTTTTCTTCAGAAGTGTTTCAGCTAAAGAGCCAATCATGCAGGGCTCCATCTTTTTTTCAAAGGTCAGCATTGGGTTCTGTAAGAATCTGGTAACAAAATCCCATAGTCTTTTGAAGTACCTCCTTCCTCTTACTATGGGCTGTAAACAAAAGCTTCTGGGCAGCAGTGGCAAAGGAAATGAAATCTTCAGACACATCAAACTTCATGCGTATATACTCGTAAGGGTCTTCTTCCCAAAGTTCCTCATCAGCATCTGTATAACACATCAATGGAAAAATAACATCTTGGATAATGCCTTGTATATGGGGCTTCAGATTCTTCCAGGTGAGAGCATGAGAAACTCCTTGATTAATAGAATTTAATGTCTGTTGTAAAACTTGAGGAGCCATATATTGCTTCTCGTTGTACTGTTATAACACTTTCAATAAAACTTGCTGGACACCAACAACAAATTCCTTCAGAAATACTTGAGCAAATTCATTATACTCCTAGGAAACACTGCCAGAGCTTCCATATCTTTCAAAAAGTCTTGCTAAAATATGTAAGGCCCACTTCTTGCATTTCCATTATGATAACTCAGGTCGGTCATCTTCTTCAATTCGAAGTGTTTCAGTCTTTAAAATTTCTACCCATTCTGTCAGGTTCTGTTGGTTTATCAGTTCCAGTGGTATAGAGTATAGAGTATATACTGAACAAGAGCATAGAGTATATACTGAACAAGATCATAGAAGATCTTGAATATTTGTTTCTGGATGACGACAGACTGATCAGACTGGTCAGAAAGAAGCTGGATAAAATGATCCTTTAGAACTGACAGAAAATGCTGCATTGCTGCTACCAATGGACTCCACTCCTCTAGTTTTTTATACTCATAAGTTTTCACAAGCTGATAAAGGCAAATAATTCCTATCCAACAAGCACTGTTATCACACTGAAGATAAAAGCCAGTTTTGTCCACAATGGCAGTCCAGCAGCTTGGATAATCACGTTTGGTGATGTGATGAATGCATGTAGTAAGCTGTACCCTGATGAGCTCAGGAGGATGGATAATGGCTTCTACAATATTTTCTCAAATACAATGGCAATCTTCTTCTGGAATAGTATAAGGGGATATATACTTTTGTGCTGTTTCTTGACCAGGCCAATACTGTGTTATATTTTTCAAATAGATAACACCTGCCTGTCTCACAGGTAAATCCAGCTGTTCCGACATAGTAATCTGGAGCAGCGTTGAGACAAAATTCAGAGATTTGTGTGCTTCATTGAGCTGGCGCTCCATGGCCTCTTGCAGGGCTGGGTCCATGGTGCCCCGCAGGGCCTCGATAATGGTGTTGGGGTCCATTGCAGCATGAACTAGGTCAAACCCAGGGCTTGAGTGCTACTGGGCCAGGAATAGCACTACTCACTGCACACATGGACCTGCCGCAGCGGCAACTGGCGCAAAAGGGCAATGGTGCAATCTTAACTCACTGTAACCTTGAACTCCTGGGCTCAAGTGATCCTCCCACCTCAGCCTCCCAAGTAGCTGGGACTGCAGGCTCACGCTACCATGCCAAGCTGATTTTGTGTTGTTGTAGAGATAGGGTCTCACTATGTTGCCCAGGCTGGTCTTGAACTCCTGGTCTTAAGCAATCATCCTGCATCAGCCTCCCAAAGTGCTGGATTTACAAGCCTGAGTCACCATGCCTGGCCAATATTTTCAATAGTTAGAGGCAGGATTGAAAAACAATTCCTTTTTGCTTTGCTCAAAATAAGTATTTATGAGCATCCACTTACGAGTTACTGTGCTAGATGCTGGACATACAAATAGAAATAAGACCCAGTTACTGCTGTTGTGGAAAGGGCAACATTAGAGAAATGTTCAGGAAATGGAGGAAAGGCCCTTATCTCAGCTTAAGGAAGCCTTAACTCACTATTGTTTGGCTGAATCTCAAAAATGTACAAACCAATAGGAGTGTCCCCTTCTTCCCTACAGATTCCCTGAAGCCAGTGGGCTGTCTGGCAGGAAAACCAAATACTAACTGTGATTTGCCCATTCTAGAAGGTAAGAGAAGGGATTCAGGGCATGCGTGTAAAGTTAGGCTTTGATGACTTGTGTTAGAAGGTTCAGGAAGAAAGCCGCATCACTTATCCCCTATGGAAAAAAAGGAATGGCCAAGAGAACTTCCTTGAATCCATGAAGAGCTTCCAAAAAGAGAAATTTTAAGTTTAGGGATGATAAGGAGCAGAAAGGCTTGGTCTGCTTTACCTGGTGAGCCTATCAATGCACCCACCAAGCACATGCTTGTTACCCAGCAGAGTGTTGGGCACTAGGGGGTGGAGGAGGATAGAATCTAAGATTACTTTTAGCTCTGAAAATCTCAAGACCATCTAAGTTAGGCTCTTCATTTTACAAAAGACAAAGTGCAGACCCAGAAAAGGCCTTATCCAAAATCACATTACTAGCTCTTGAGTACAAGATTACTAGCAGGCTGCAATCTGGGAAGATGGCTGAAGTGGACTTGACATCATATTAAACTCCAGCATCAGTACTTTGGGCAACATGTAGTCACCAGAGGTCTCTGAGCTGGTGACCAGCTTAGTTAAAACCACTTTCCCCCTTGATAATAGTAAATGCCATTTCCAGTTAAGTTACAGATGACAGATTTTATGGAATGTTTCCACCTTAATGTGCGAGATCTGAATGGTACCTCCATCACTGACATTACATTTTGTTTCTCAACCCTCCTCTTCACAGCTCTTATTAGGAAATCGGGGAAAGTCAGGTGCTGAGGCCCAAAGGAGCTGTGCCTTGCTGGTGTTCCCTCATGAAAGGCTGCAGCCAGAACTGTGTCCTTCCTTCTCAATGCAGGTCTCTATGCTAAACTTGTTCACCCTCTGTTCCAGAGCTTTAGGTGCTCCACACGAAGTACTCTTGAACTCTGTCAACCCTGACCTCTCCCCTGTCATGTAGAAAGGCCTCAAGTGGTAGTTTTTGGAGCTCCCGATCATACAAGCACATGCACCCTTCTCAGGAGAGGGCAATTAGGAAACCTGCTGCTAACTAGAGGTGCCATGGCAGGTGCCAACTGGATCAGTGCAGGATGGAACAGCACATTCCAGACAGCCTCATGAGTTCATTGCTAAGGGTAGAGCTAATTTACAGGAAACATGCAGAGGGTTTGACTGGATCCCCTCTGATACCAGCTGAGCCCAGCTCTCACATGCCTATGGCATGGAGTGGATGGTGCTGGGGCAGGCTTCTCTCAGCCTGACAGCAGAGTAGCTGTCTCCACTATTGAGCCAGGTGTGACCCCAGAATGCCATCTCTACCCCCTCAGCATGGTAGCAATGCCACGGCAGTGAGGATGTGGGGAATGAGGAGCAGCTTAGGAGAGACTAAGGCATTGCAGGACTGAGGTCCACTATGCAGCTCCAGGTCCCCCTACTATGCTCCTTCAAGAACAGTGTTGGTAGTAAGAGATTATCACCAAGTTCCTCTCAACTCAGCAAAACAAGTGGGGAAGCGAGAAAACAAAGGAGGAGGAAGATAGCTTCCTGTGCTGTGAGGACTAATTGCAAGCAAAATATGTGTCAGCTGCCACTGCTCACAGTAAACACTCAACGGATGGTAACCCTAAGGGTTTGGGCTGCAGCTTTAGTGCCCAAATCCTACCTCTATGGAGGGAGTGAGACACTTGGACAACAACAATCAAGGCAGGTGGAGAAAATTCTGGTTTTGCTTGTCCCAAAACAAATCACCTCACCCATAGCAGTGTAAGACAACTAGCATTTTACTATGTTCACAGATTCTGAGCACGAGAAATTTAGAAAAGGCCCAGCAGGATGGCTTGTCTCTCTTTCTTATACCTGGAGCCTCAGCCGGAAAGATTCAAAGACTGGGATGACTTAGTTGGAATCATCTATGAGCCAGTTCATTCACATAACTGGTGGTTGACCCATGCTGTCAGCTAGAACCTGAAGCTGTAAGCTGGAACACCTATACATGGCCCTTCCATGTGGCTCTTTGAATTTCTTTACAGAATGGTAGCTGGGTTCTAAGAGCAGGTGTCCCAAACAAATCACACAGAATCTGTATGACCTTTGATGACTTAGCCTATCACTATAATGTGACTTCTGCCATAGCCACAAGGCTTTCCAGGTTCAAGGGTAGAGAACAAGTATCAAAGGCAAATTTTTAGAAGAACATGTGGAATGGAAGGTAATGTTAAAGCTATCTCTGGAATATACAATCTGCTTCATTTGTCAAGCTAAACATATGCCCCCATAGTCTCCCAATGCAGAGATATTATGTACAATGTCTGGAACAAATATTTTCATATGACAGCTCATTAATTCAGTCCTTACAATAATACTGCAAGGTAATTTATTATTACTCCACGTTTTACCTGAAACTGAGCTCAAAAAGTTTAGATAACTTGACCAAGGTCATATAGTTTTTAAGCACCAAAGCAGTATCAAATCCAGATCTAAATCTGTTAACTACTTGTTAAAACTCAAAGCTCATAGTCTTTAGAGAACATTTTGGGTCAAACTAAATGATCTTGGTTCTAGGGCAGTAGGAATAAGGTAGCAAAGAAAAAAAAAAGGCAGCTGTTCATTTGATGCCTAAATGTTCACAGTGTACACACAATGCTGAAGCTACGCTTTGTAACTCTTAAGTGTTATTTCTTTTGCTAATAAATGCATTTTATGTAAGGAAAGACTTTGAAAAACAGTATCTCCAGATAGAATGGAAGCTGGGCCACCTTGCTAGGCTCTCCTACACCCCAATCGCATTTTCCAAAGTAGGGAGAAAGGTACAGTTCAGAACCTCTGTTTTTCAAACTGGAATAAGGCCTCTCTCTTACTTTTCCCCCAACTCTTTAAGACAGACAGTTTTTATTTTGAAACTTGGCCTAGATTGTGGGGCAAAGCACAACCAAATGAAATGGGTGAATTCCCATTTTGATCCTTATTGTCATTCTCCATCTCAGGTAGCTGATGGATCCAGGCTAAATGTGGGTCAAAAAGTATGTTATAGATCAGCTTTAGTTGAAAAAAAATGTGTATACACCAATACAACTCAATGGGGGAATAAAAACTTTTTCAACAAATAGTGTTAAGACAACTGGATATCTGCATGCAAGTGAATGAAGTTGGACCCCTACCTCACACCATACACAAAATTTAACTCAAAATGGATGATAGTCTTAATTGTAAGAACTAATGCTCTAAAACTCTTAGATGAAAATATAGGGGCAAATCTTTATGACCCTGAGTTAGGCAAAGCCTTTTTAATTGTGACACCAAAAGTACAGTCTACAGAAGAAAACTAGAAAAAATGGACTATATGAAAACCTAAACTTTTGTACTGCAAAAGATACCATCAAGCTAGTAAAAAATGCAACCCACAGACTCGCAGAAAATATTTGCAAATAAAATACCTTATAAGAGATTTGTATCCAGAATATATTACAAAAAACTCATAACTCAATAGTGAAAAAATAACCCAATTAAAAATAGGCAAAGAATCTAAATAGACATTTCTCCAAAGAAGATATAGAAATGGCCAATAAGCACATGAAAAGATGTTCAACATCCCTAGTCATACGGGAAATGCAAATCAAAATCACAATGAGACATCACTTTACACCCATTAAAATGGCCATAATCAAAACGACAAGTGTTGGTGATGATGTAGAGACATTAGAACACTGAAATTGTTGGAAGAATGTAAAGTGGTGCAGATGCTTTGGAAAACAGTTTAGCAGTTCCTCAAGATGTTAAATGTGGAGTTACCAGATGACTCAGCAATTCCACTCCTAAGTCTATACCCAAAAAAGGCAGAAACAAATGTCCATATGAAAACTTGTACATGAATGCTCATAATGTTCATAGGAACATTGTTCATAATGGCCAAAAATGTGAAAACAGCCCATATACCCATCAACTGATGAACAGATGAATTAGATGTGGTATAGCCATACAATAAATTATTATTCAGTAATAAAAAGGAATGAAATACTGATAAATGCTACAAAATATTAGAACCTTGAAAATGTTATTCCAAGTGAAATAAGCCAGTCACAAAAGACCACATATTGTACAATTCAATTTATATGAAGTGTCCAGAACAGGTAAATCTACATTTAGAGAAAGTAGATTAGTGGCTGCCTAGGGCTAGGAAATGTGAGGAGAAATGGAAAGTGACTGAAAATGGGTATGGGGTTTCTTTTGGGAGTTATGAAAATGTTCTGAAATTGATAGTGGTGATGGTTGCACAACTCAATAATATACTTAAAACTATTGAATTGTACATTTTAATTATGCAAATTGTATGGTAGGTGAGTTTTATTTCAATATTTATATCCACACACACCTACACATAGAATTATATGTATATGTTTACACACACACACACACACACACACACACACACATATATATATATATATGTGTCCAAAGCAAATTCATATTAAAGTGGGGGCAATGTCAAGTATAGAAAACCACCCACAGATACTCCTCTGCTTTAGCCTAACATGTGGCTGTGTGACCAAAGGTACTGTGAAAAGCAATTAGATGGTGTTTTCTGAAAAAAAATTTTATTGAGGTATAATTTACATGTGACAAAGTACTCCCATTTCAGTTCATAGTTTGATGTGTTTTCACAAATGTGACCACCATATAACCAACACATTCAAGATACAGAATATTTTTATTACCCCAAAAAGTCCCTTGTGCCCCTCTGTCTCAAAATGCCCAACCCTAGGCAACAATTGATCTACTTTATGTCATTTTAAGTAAGTTTTGCCCTTTTCTATAATTCCAGATAAATTAAATCCTACAGCATGTACTATTTGGGACCTGGACTTTTTTATAACTCAGGATAATATATTTGAGATTCAACCATGTGTCATGCATATCTCTAATACATTGCTTTTTTATTGCTGAGAGTATTCCCTTATATAAATAGACTAAAGTTTGTTTTGCACTCATCTGCTTAAGGACATTTGATATTTTTCCCTCATTTTAGTTATTATGAACACTGATATACAAGTTTTTGTGTGAACATATGTTTTCACTGCTCTTTGGTAAATGAACAGAAGTGGAAACACTAGGTCTTATAAGTGTATGCCTAACTTTATAAGAAACTGCCAACCTGATTTCCAAAATGTTAATACTATTCTACATACCCACAAGCAATATATGTAAGTCTTTTTAATTGTATTCATATAGTGGGTATCTCATGTAGTTTTCAATTGCCTTTCCTTGATGACTAATTAAATGGAACATCTTTTCATGTGCCTTTGGCCATTCATGTGTGCGTGTAAAGTGTCTGTCCAAATCTTTTGCCTATTTAAAAAATTTATTTTTAATTGAGTTGTATAAGTTTTTTTTAATACATTCTGGATTCAAACCTTTATCAGCTTAGTCTGTGGCTAAAAATTTCATTTTCTTAATGGTGTCTTTCTTAATAGTGCCTTTGATAAAGTCTAATGTATAATTTTTTCTTTTATGTTTCAAATGTTTTGTGTCGTAAGAAATCTTCGCATATGCCAATGTTGAAAAACTTCTAGTTTTACAGTTTTAATTTTTATGTTTCAGTATACTACCTATTTCAAGTTAATTTTTGAGTCTACAGTAAAGGGTTGAAGTTCATTTTTTGTATATGAATATCCAATTTTGTAGAACCATTTGTTGAAAGCCTATTTCCCCACTAAAATATCTTCTTAACAACATTTAATCACAAGATTCTTCATTTCCCTTTTATAGTCACACCCACTTCCTTCCAACTTTCCTTTAATCCTCTTCTCATTAACTCCTACCAACCACTAATCTGTTTTCCCTTTCTATAATTTGGTCATTTCAAGAATATTGACTATATGGAATCATAAAGTATATAACCTTTTGGGATTTGCTGTTTATTCTTTGCATTTATCCATGTATGATGTTTTTCCTTCATTTGTATAGATCTAAATTTCATTGATAGTATTTGCCTTGCATCTGAAGAACTTGCATTTTAAGTCAGCTGGTGAATAATTCTGTCAGCTTTTGTTTGCCTGAAAAAGTTTTTATTTCATATTTATTTTTGAATGGTATTTTTATTGGATATAGAATTCTAGGTTGACAGTTTGCTGTTTTTGTTACAGCTCTTTAAAGACGTCATGTCATTTTCTTCTGATTTAAAAGTTTCTGACAAGACATATGTGAGTATTGTTATCTTTGTTCCTCTGTATGTAATTTTTTTGTCAGCTCTTAAAATTTTCTCTTTATCAATTTTGTTCAGTAATTTGATCATGAACTCCTTTGGTGTGATTTTATTTTGTGTTTATCCTTCTTGGAGTTGTTGACCTGCTTGGATCTATGAGTTTATAATTTTCATAAAATATGAAAAGTTTTTAGCCACTACTTGTGATATTTTTTCTGCCCTTCATCCTTTCTGGGACTCCAGTGATATGCATATTTACAATAGCTGCTTAAAAGACCTTGTTTGTTAATTCTATTTTCTCTGTCATTTTAGGTCTATTTCTGTTAACTGATTTTTCTCCTAGTTATAAGTCGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGCTTTTAGGCATGCCTGGTAATTTTGGATTGGATGCTGGACATTGCGCCTTCATATTGTTGAATGCTGGATATTGTCCTCTTTAATGGATGTTGAACTGTGCTCTTACTGGCAGTTAACTTAATTACATATCAGCTTGATCCTTTTTTAGGCTTTATTAAAACTTTATTAAGTAGACTTTACTCTAGGGCTTATTTAGTCCTATAACTAAGCTGTGACTTATTTTGGAATGCCCTCAATATTAAGCAAGGACCCTAAATTTACCCTGGCTGGTCATAACTCAAACTTCTACCAGCCCTGTATTGCCTCTGGAAATATTCAACTTACAGATACCTGGTAGTTCTTTGCCTGGCTTGTGCAATTTCAGCCTACATATAGCAGTCAGCTGTAGTTACAAGAGGAATGCTATAAAGATCCTCAGCATTTTCTCTACTGAGCACATTCCAGCCACTCAGCCTCTTCAAATTCAAATTTTTGTCTTCTCAACTCTGTGATATCATGCTCTTCTTGAGTGTGTATTGTGGTCCAGAAAGTATCTCCAGGCAGAAAGTTGGTATTATCATAGGTCTTATCTCATTTGTTTCCTTTCTCTGAGGAGTCACAGAACTGTACTAATTACCAAAAGGAGTTTTTTTCATAGATTTTTGTCTGGTTTTCTAGTTGTTTACAGTAAGAGAATAAGTCCAACTCCATTCACTCTCTTGTGTCTGGAAGTAGAAATCACTGATATTATCTATGTTAATACAGTGAAAAAACATCCAGTGTTGTCCCTCTTTCCATCCTCACCCCCACACCTCCACCACTAATACTGTCTCAGTGATGTGCAATATCCAAGGCTTGATTTAGGTCTAATGAATATCTCTCAACACAGAACACTTTGGGTTTCCCAGCACAAGAATTGAAAAAAGCACATGGTACTCTCCCAGCTGAGATTCTTAGCCTCTTTTTTCCCCTACTGTGAGCAGTGTCACCCAGGTGCCCTCACTCATCTATTTTAAATACACTCACCATCTCTGCTAACAGCTTCAGCCTCTGTTAATCAGGTAGCTTTTCATTAATGTTCTTATCCTTGTCCCAGCATCTTATTTGTCATGCTTTATTAGTAGACATGATAAGTCATAAATCTTAGTTCCTCTTAGCTTCTTAGTATCTGTTGTCAAGTTGAAGATCCCAGACAGAGGGAGATGAGAACTGGTTCATTACAGAGTGACTCTTTCTAATATCTCCTTGGTTCTTTATGATACTAATACATTCTTCCCACTGCAGTTGCCTTTTTCTCTATTTAGCTCCAATACAATTCATAGAAATGAGATCATTCGGCTTAAGGGTACATTATCTTCACTTCAACCCATCCTTCTTTAAGATGAACAATGCTGCCTTTAGATTCTGATACTGGCTCTGCCACTTATTAGCTGGATAGCCCCAGACAATTTACTGACTCTGAGTTTGTTTCCATACTTATGGAATAGGGAAAATATATTCTGCATATCTCATGGAGTGGCAACAAAAGCCAAAATTGACAAATGGGATCTAATTAAACTAAAGAGCTTCTGCACAGCAAAAGAAACTACCATCAGAGTGAACAGGCAACCTACAGAATGGGAGAAAATCTTCACAACCTATTCATCTGACAAAGGGCTAATATCCAGAATCTACAATGAATGCAAACAAATTTACAAGACAAAAACAAACAACCCCATCAAAAAGTGGGCAAAGGACATGAACAGACACTTCTCTAAAGAAGACATTTATGCAGACAAAAAACACATGAAAAAATGCTCACCATCACTGGCCAACAGAGAAATGCAAATCAAAACCACAATGAGATACCATCTCACACCAGTTAGAATGGCAATCATTAAAAAGTCAGGAAACAACAACTGCTGGAGAGGATGTGGAGAAATAGGAACACTTTTACACTGTTGGTGGGACTGTAAACCAGTTCAACCATTGTGGAAGTCAGTGTGGCAATTCCTCAGGGATCTAGAACTAGAAATACCATTTGACCCAGCCACCCCATTACTGGGTATATACACAAAGGACTATAAATCATGCTGCTATAAAGACACATGCACACGTATGTTTATTGCGGCATTATTCACAATAGCAAAGACTTGGAACCAATCCAAATGTCCAACAAAGATAGACTGGATTAAGAAAATGTGGCACATATACACCATGGAATACTATGCAGCCATAAAAAAGGATGAGTTCATGTCCTTTGTAGGGACATGGATGAAACTGGAAATCATCATTCTCAGTAAACTATCGCAAGAACAAAAAACCAAACACCGCATATTCTCACTCATAGGTGGGAATTGAACAATGAGAACACATGGACACAGGAAGGGGAACATCACACTCTGGGGACTGTTGTGGGGTGGGGGGAGGGGGGAGGGATAGCATTGGGAGATATACCTAATGCTAGAGGACGAGTTAGTGGGTGCAGCGCACCAGCATGTCACATGTATACATATGTAACTAACCTGCACATTGTGCAGATGTACCCCAAAACTTAAAGTATAATAATAATAAATTAAAAAAAACAAAATATATACATAATATGATCTCGGCTATGGAAAAGAAAAACATTCAGTGGAAAAAAGCTTAAAGGGAAGAGCACCAAAAAAAAAAAAAAAAAAAGATCAAGCAAGATAATCGATGTTAAGTACTTTATATAGTGCCTGTACCATGGTAAATGCTTAATAATTGTTAGCTATGATGACAATAATGATGATTAAAATGGTCTTTCCATACACTCTGCATACCATCCCTCTGACTGACCTGATGATTATAATTATTCCCTAACTACTAGCAAAGAAGCTTCAATCTCCCTTCACTTCTGCTTTTAAACAGTTTTCTCCTATTTTACAAAAAAGAGTGTGTCCTTTTCTTCCCTTTTCCAGCTCTTCATAAACACAGTGTATTAGTCCATTCCTTCATTGCTATAAATAAATACCTGAGACTGGGTAATTTATAAAGAAAAGAGGTTTAATTGTCTCATGGTTCTGCAGGCTGTACAGAAAGCACGATGCTGACATCTGCTCAGCTTCTGGGGAGTCCTCAGGAAACTTACAATCATGGCAAAAGGTAAAGGGGGAGCAAGGTGTCTTAC A 100 PASS CLUSTER_NUM=25425;CONTIG=TGGAAGGCAACTGTCGTTTAAGATGAAAAACAGTGATAACTGCTGAGAAATCTCAGCCTTAAGTGTGTTGAAAGTTGATAATGTCCATCTATGTGGTGAACAATTTGTGAAACAAGACTGTCAAAGAGAGTTATAGGTTCTTGGAAGTAAGAGGCAACATCTTATGATCAAGCTGTTGGGTTATCTCTTTATGATCTTCAACTACACTAAGAAGTGTGTCAATTGTATTCAGAATTCCCATAGCAGTAACTGCTTTGTCATCACTACCTTCTTCATCTGGCCCTGTCTGGATTACTTGGCTAAATGTCATTGCCAACTGTTGTGTCATTTCTACTGCAATAGGAGTAACTTCTTCACTATTTTCACAGATCATTTTCTGAATTACATTGGTAAGGTCATCATTTTCTGTTTCTGTTATAATATGAAGAAGAGCCTGCATTACAGGTCTGATAAATGCTGTGATACATTCTTTAGATTTTTCTTGATTGCTGATAAATACTTGAAGGACAATGGCAGCTTCCACTTTCACAGGCATGTCTCTGTCATCAATCAGACA;CONTIG_NUM=24722;DOWNSTREAM=TCAAGCTGTTGGGTTATCTCTTTATGATCTTCAACTACACTAAGAAGTGTGTCAATTGTATTCAGAATTCCCATAGCAGTAACTGCTTTGTCATCACTACCTTCTTCATCTGGCCCTGTCTGGATTACTTGGCTAAATGTCATTGCCAACTGTTGTGTCATTTCTACTGCAATAGGAGTAACTTCTTCACTATTTTCACAGATCATTTTCTGAATTACATTGGTAAGGTCATCATTTTCTGTTTCTGTTATAATATGAAGAAGAGCCTGCATTACAGGTCTGATAAATGCTGTGATACATTCTTTAGATTTTTCTTGATTGCTGATAAATACTTGAAGGACAATGGCAGCTTCCACTTTCACAGGCATGTCTCTGTCATCAATCAGACA;END=211033725;NS=1;READSOURCES=(0:33:68,1:0:69);SOMATICSCORE=60;SVLEN=-12257;SVTYPE=DEL;UPSTREAM=TGGAAGGCAACTGTCGTTTAAGATGAAAAACAGTGATAACTGCTGAGAAATCTCAGCCTTAAGTGTGTTGAAAGTTGATAATGTCCATCTATGTGGTGAACAATTTGTGAAACAAGACTGTCAAAGAGAGTTATAGGTTCTTGGAAGTAAGAGGCAACATCTTATGA;ensembl_gene_id=ENSG00000143473 GT:GQ 1/.:.
chr1 249175897 chr1uGROUPERuDELu4u25993 CCATACTGAACTATTAAAGTTATTTGAAATGACAATTGTAATAATATCTTCCTTGAGGAGTTCTACAATCTTTGCTGTTATTTCTTTAAGTCCTTCCTTTAATGAGTACTGTTTGGTGCATGTAACCTGCTGTGGTGTAGACAGTGTTATGGACTTCATTTTAATTTGAACTAGGTTAGAAAATTTTAGTTCCTCTAGTTTCCTTTAATATAAGTTAAAAAGATTTGGAATAAAATTCATTCCTGTAATGTCTTATAATTTGGGTGAGCAGTAAAAAGTGCATAGAGCAGTATAGAAGCAGAGG C 100 PASS CLUSTER_NUM=140439;CONTIG=TACTGAACTATTTAGATATCCCTGTGGTAATGTTTTGAATTGGTATTGTTTACCTTCCCATGTAAAGTTGGTATATTCCTGGCTTGCTTTATTTATTGGTTTGGCAAAGAACACATCTGACATGTCTATGATTGTATAGTATTTGTCATTATGATTAATGATCTTATTAACTAGCTCTTCTACATCTGGTAATGCTCTTGGCATTTTAGTTGAGACTTTATTTAAATTTCTATAGTCAATAGTTAATCTATAGCTCCTGTTTGTTTTTAAGACAGGCCAAGAAAGCTTCAAGTTTATTTACCTCTGAGTCCTTCTGTATGAATGTTTATTGTGGGATCTGGCCAGCAGCCCGCAATGCAATGGGGCTCTCTCTTTGTTCCCAGGCAGATCGGCAGGTTGAGAAATAATAGACACACACAAGATAGTGAAAGCTGGGTCCAGGGGGGTCACCGCCTTCTGGTCCCACGGAGCCAAAAATGCACGGGATATACCAGCATTTATTATTAAGTTTAGTGAGGGCAGGGGTAGGTTAGTGAGGGATTTAGGGTCATTTGATTATGAGGTTAGATGGTCACATGGGGATGAAGTAATTCTTTAACATAACATCTGTATGCAGAAGTACAGTAT;CONTIG_NUM=136911;DOWNSTREAM=CAAGAAAGCTTCAAGTTTATTTACCTCTGAGTCCTTCTGTATGAATGTTTATTGTGGGATCTGGCCAGCAGCCCGCAATGCAATGGGGCTCTCTCTTTGTTCCCAGGCAGATCGGCAGGTTGAGAAATAATAGACACACACAAGATAGTGAAAGCTGGGTCCAGGGGGGTCACCGCCTTCTGGTCCCACGGAGCCAAAAATGCACGGGATATACCAGCATTTATTATTAAGTTTAGTGAGGGCAGGGGTAGGTTAGTGAGGGATTTAGGGTCATTTGATTATGAGGTTAGATGGTCACATGGGGATGAAGTAATTCTTTAACATAACATCTGTATGCAGAAGTACAGTAT;END=249176200;NS=1;READSOURCES=(0:44:63,1:0:64);SOMATICSCORE=60;SVLEN=-303;SVTYPE=DEL;UPSTREAM=TACTGAACTATTTAGATATCCCTGTGGTAATGTTTTGAATTGGTATTGTTTACCTTCCCATGTAAAGTTGGTATATTCCTGGCTTGCTTTATTTATTGGTTTGGCAAAGAACACATCTGACATGTCTATGATTGTATAGTATTTGTCATTATGATTAATGATCTTATTAACTAGCTCTTCTACATCTGGTAATGCTCTTGGCATTTTAGTTGAGACTTTATTTAAATTTCTATAGTCAATAGTTAATCTATAGCTCCTGTTTGTTTTTAAGACAGGC GT:GQ 1/.:.
chr10 20219603 chr10uGROUPERuDELu0u11231 AAAAAAAGGCTGGCACGGTGGCTCACACCTGTAAATCCCAGCACTTTGGGAGGCCGAGGTGGGTGGGTCACCTGAGGTTGG A 47 PASS CLUSTER_NUM=60987;CONTIG=GTATACTGATTTTGGAAAATATGTCAGCTCAATTTGGAAGATTGCTAAACCACCTAAAACAGAGCCTGTTTAAAAAATAAATAAATAAAAAATAATAGTTCAAGGCCAGCCTGACCAACAAGGTGAAATCCCATCTCTACTAAAACTACAAAAATTAGC;CONTIG_NUM=59978;DOWNSTREAM=GAGTTCAAGGCCAGCCTGACCAACAAGGTGAAATCCCATCTCTACTAAAACTACAAAAATTAGC;END=20219683;NS=1;READSOURCES=(0:7:18,1:0:60);SOMATICSCORE=40;SVLEN=-80;SVTYPE=DEL;UPSTREAM=GTATACTGATTTTGGAAAATATGTCAGCTCAATTTGGAAGATTGCTAAACCACCTAAAACAGAGCCTGTTTAAAAAATAAATAAATAAAAAATAA;ensembl_gene_id=ENSG00000120594 GT:GQ 1/.:.
chr11 56932527 chr11uGROUPERuDELu1u8703 CCAGAGCACATCATGAGATCCTGGAGCCAGACCTAGAAACCTATTAAACAAGGGAACCCCAGCATGTCTCATTTATTACCCAAAGGAAGGAAATTAGCATCACATGTATAAAGCACTCAGTAGTCTATAAAATGCTCTTAGCAATTCACTTCGTGAGGAAGTGCCTTTTCCCACTTCCACAGAGGGATACCGAGCCTCAAGGGATTAGGAGACTAATCCAGGCTCACACAGCTGATAAGGAACAGCCCAGACATTTTGGCCCAGTGCTGCTAGCCCTCAATCTGGTGCTTTGCCCTCTGCACCGCCTGCCATGCAGGGAATACATGTTAATATCTCTCTGTATTAGTCTGTTCTCATGCTGCTAATAAAGACATACCCAAGACTGGTTAATTTATAAAGGAAAGAGGTTTAACTGAATCACAGTTGCACATGGCTGGCATCATGGTGGAATGCAAAGGAGGAGCAAGGCCACATCTCACATGGTGGCAGGCAAGAGGGCATGTGCAGGGGAACTCCCCTTTATAAAACCATCAGCTCTCTGCTGGGTGTGGTGGCTCACACCTGTAATCCCAGCACTTTGGGAGGCCGAGACGGGTGGATCACCTGAAGTCAGGAGTTCGAGAACAGTCTGGCCAACATGGCGAAACCCCATCTCTATTAAAAATACAAAAAAAAATTAGTTGGGCGTGGCAGTGAGTGCCTGTAATCCCAGCTACTCGAGAGGCTGAGGCAGGAGAATCACCTGAGCCCAGGAGGCAGAGGTTGCAGTGAGCCAAGATCACGCCACTGCACTCCAGCCTGGGTGATAAGAGTGAAACTCGGTCTCAAAAAAAAAAAAAAAAAAAAAATCACATCTCACGAGACTTATTCACTATCATGAGAACAGCATGGGAAAACCCTGCCCCCATGATTCAATTACCTCCCACTGGGTCCCTCCTATGACATGTGGGGATTATTACAATTCATGGTGAGATTTGGGTGGGGACACAAAGCCAAACCATATCACTCTCTTTCTTGGCCACAGGTGGACTTGAAAAACCCTTTCCCTTAACCAAGCAGGAGCCCCAGTAGCTGCTTTGTTCAACGTCTGTTTCTCTAAGGTCTCCTACTCTGGAATATTTAGGAAAACCCAAGGTGGCTCAAAAAGATCATCCCTGTACCAAGCCTCAGGGATTCTAGTGTGACCCAACCTCTCCCAGTCCCTATAGGCATCTCTTTCAAACATCAGAACTGGTGCAGACTCAATAGAAGAAAGGTGTGACTCCAAGATGTCCTCCCTCACAGCCCTTTATCACAATGGGGCTCTCTTCACCGTAGAAGGGAAGGCTGAGGCTCAGAAATATGGTGTAGGCTTGGACTTTGGAAGGAGAATGACTAAGCTGAAGTTCTTCCTCTGCCATTTACAAGCTGTGTGACTTTGGAAAACTTTCTTAATGTTTTTGCTTTTAATTTCCTCATGTATAAAAGATGGGGTTGTCATACTTAGGTTTAAGACTATTGCACGTGCCTGTAATTCTAGCACTTTGGGAGGCCGAGGTGGGCAGATCACTTGAGGTCAGGAGTTTGAGACCAGCTGGCCAACATGGTGAAACACCATCGCTACTAAAAATATAAAAATTAGCCAGGCATGGTGATGCATGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGATTCGCTTGAACCTGGGACGTGGAGGTTGCGTTGAGGCAAGATCACGCCACTGCACTCCAGCCTGGGCAACAGAATGAGACTCCACCTCAAAAAAATAGAAGACTATTGCAAAGATTTTAAAAGATGGCACAGGTACAACACTGAACACAGTGTTTCATGAGTGACAGTCATAAGCTTTTCTACCACCTAACTGTGTTACTTTTAGCAAACTACCTAATTTATCTCGGCCTCGGTTGTTTTGTGATTCTTTTCAAGGGAAAAAAAAAGCACCTCCCTTCATAAGCCTGCTATAAGAACAATATAAAATAGTTGACATAAAGCACTTAATCTCTTGCCTGTCACAGGAAAGGTGCTCAACACCTGTTAGCTCTGTGTTGATGTCCCCAGATCAGAGAGCCAGAAAAGGAGGGCTAAAGTTCCAACCAGGATCTTCTGGTTCCAACCCAGCAGCACCTGAGCAAGGTTGATAATGGTAAAGAAAAGAAGAAATAAGCAATAGGGGCCTCACAAACACAGGCAGGAATAAATCACTCCCATGTGGCAGTTTTCTGTGCCTGACCCAAGAGATAGGTGTTGCACCTTTATCCATGTGGACAGATAAGAAAGAGCAAAGGGCATAGGTCACAGAGGTGAGTATGACCTCATTGCAGTGCCAGGATATTTCCAGGCAATTGGCAAGACTTATTGACAATCATCCAATAAATAGGATAAATAGTTCTTACTTCCCAAGTGCCTGGGAAGAGAGCTTGCAGCTCTTTCCAATTCCTGCCTCTCATCTCTTCCTCCTCGGACACTGCAGCTCTCCGTTTCTGGAAAATCTCAGGGCAGAATCTGGGCTCCTTCCCACTTTCCTCTGTCCAGAATTCTAAGGATGCCTGGGAGAAGGCATCTGCCCTGAATGAATGGGTCAGAGGCATGATTCCAAGTGACTGGCTGGTAATTGGAAGAGCTCAGTGGTCTGGCTGGGGAGATGAGAGCCTGCTAAGCACATCTGGCCAGCATCAGAATCACAAATTGAAGAGAGCTTGGAAGGACTCAGCCCCCACTGACATTCACAAAGGAAGGAAAATGTAGGGAGCCAGACAGAAAGGAGTGATGCTCTTCAAAGTCAACAGGCTTATAACAAACACCATCTCATAGGTGAAAGTGGGAGCACAGAACAGGCACACTCAGCTAACACACAGCTTTCTGAGGGAGGTCATCCTCCACCAAATGAAAATAGCCCTGCTTTTTCATTTTTTAATTTTTATTAATTTTTAAATCAACAAATAAAAATTATATATATTGGCCAGGTACAGTGGTTCATGCCTATAATCCCAGCACTTTGGGACGCCAAGGCAGGAGAACCACTTGAGACCAGGAGTTCAAGACCAGCCTGGACAACATAGTGAGATCCCATCACTACAAAAGAAAAAATATTTAAGGAAAAAAATTGTATATATTTATGGCATACGATGTGAAGTTTTGACATATCTACACATTGTGAAATGATTAAATCAAGCTAATTAACATATCCATCATGCCACATCCTTAAATTTTTATGGTGAGAACATTTAAGATCTATCTCAGCAATTTTGAAGTGCATGCTATTGTCACCATGCTACACAATAGACATCCAGAATTTATTCATCTTGTCTAGCTGAAACATTGTATCCTTTGACCAACATCTCCATACCTCTCCTGCATACCTCCCAGCCCCTGGTAACCATTATTCTCCTCTGCTGCTATGAGTTCGATTTGTTCGGATTCCACATATAAATAAGATCGTGCAATATATTTCTGTTTATGCCTGGCTTATTTCACTTAGCAAAATGTCCTCCAGTTTCATCCATGTTGTCACAAATGACAAGATCTCCTTCTTTTTTAAGACTGAATAGTATTCTATTGTGTACATGTACCACATTTTCTTTATCTGCTGTATTAGTCTGTTTTCACACTGCTGATAAAGACATATCCAAAACTGGGAACAAAAAGAGGTTTAATTGGACTTACAGTTCCACATGGCTGGAGACGCCTCAGAATCATCACAGGAGGTGAAAGGCAGTTCTTACATAGCAGCAGCAAGAAAAAATGAGGAGGAAGCAAAAGCAGAAACCCCTGATAAACCCATCAGATCTCATGAGACTTATTCACTATCACGAGAATAGCACGGGAAAGACCGGCCCCCATGATTCAATTACACACTCCCCGCCCCTGCTGGGTCCCTTCCACAACACGTGGGAATTCTGGACAATATAATTCAAGTTGAGATTTTGGTGGGGACACAGCCAAACCGTATCAT C 100 PASS CLUSTER_NUM=52260;CONTIG=CTTCTACCCCTGGCAGTGCAAAGTCCAGGACCAGGCAGGTGGGGGGTGCTGGAAAAGTTAGCAATTGAGTGATTGTACAGCCAATTTGTCACTTTCATGGGATCGGAGTGAGGCTATCTCAGAATCTTCTGTATCTACTTCATCTCTTGCTCTTTCCATTCTTTGATACTTTGACACATCCACATCCACTGCTCCTGGCCCCTCCGAATCTCATGTCCTCACATTTCAAAATCAATCATGCCTTCCCAACAGTCCCCCAAAGTCTTAACTTATTTCAGCATTAATCCAAAAGTCCACAGTCCAAAGTCTTATCTGAGACAAGGCAAGTCCCTTTCACCTATGAGCCTGCAAAATCAAAAGCAAGCTAGTTACTTCCTAGATACAATGGGGATACAGGTACTAAGTAAATACTGCTGATCCAAATGGGAGAAATTGGCCAAAACAAAGGGGCTACAGGGCCCATGCAAGTCT;CONTIG_NUM=52670;DOWNSTREAM=TCTGCTCCTGGCCCCTCCGAATCTCATGTCCTCACATTTCAAAATCAATCATGCCTTCCCAACAGTCCCCCAAAGTCTTAACTTATTTCAGCATTAATCCAAAAGTCCACAGTCCAAAGTCTTATCTGAGACAAGGCAAGTCCCTTTCACCTATGAGCCTGCAAAATCAAAAGCAAGCTAGTTACTTCCTAGATACAATGGGGATACAGGTACTAAGTAAATACTGCTGATCCAAATGGGAGAAATTGGCCAAAACAAAGGGGCTACAGGGCCCATGCAAGTCT;END=56936485;NS=1;READSOURCES=(0:21:23,1:0:65);SOMATICSCORE=60;SVLEN=-3958;SVTYPE=DEL;UPSTREAM=CTTCTACCCCTGGCAGTGCAAAGTCCAGGACCAGGCAGGTGGGGGGTGCTGGAAAAGTTAGCAATTGAGTGATTGTACAGCCAATTTGTCACTTTCATGGGATCGGAGTGAGGCTATCTCAGAATCTTCTGTATCTACTTCATCTCTTGCTCTTTCCATTCTTTGATACTTTGACACATCCACATCC GT:GQ 1/.:.
I used a code:
out = open('/home/istolarek/OUTintersectPT','w')
masterlist = [row for row in Pt]
for line in a:
g=[]
if line.startswith('chr'):
line = line.strip().split()
g.append(line[0])
## print line[0]
##print len(w)
for row in masterlist:
row = row.strip().split()
f = range(int(row[1]),int(row[2]))
w=[]
for i in g:
if i == row[0]:
w.append(int(line[1]))
for i in w:
## print line[0],row[0],line[1]
## out.write(str(line[0])+'\t'+str(row[0])+'\t'+str(line[1])+'\t'+str(f)+'\n')
if int(i) in f:
out.write(str(line)+'\n')
else:
break
else:
break
out.close()
This code seems to work, but takes far too much time.
So if column 1 in both files matches, go to comparing second column. Second column from file a is just a number (line[1]), in file Pt it is a range of values f = range(int(row[1]),int(row[2])). So if the first condition about matching columns 1 (these with chr values) and if values from second column from file a are in the range of f, I want to write these lines to the output.
I wrote another one:
I wrote:
masterlist = [row for row in Pt]
for line in a:
line = line.strip().split()
for row in masterlist:
row = row.strip().split()
b = int(line[1])
f = range(int(row[1]),int(row[2]))
if (line[0] == row[0]):
if a in f:
print b,f
These both should be a match. But the script only reports the first ontry from Pt file. If the first entry is not matched, the output is none. I want the script to output all matches
I'm fighting with this for quite some time.
Well, first of all, you are looping on a, but you assigned a value to a inside the loop, so it's not likely to get very far.
Second of all, I believe that strip().split() is redundant. You don't need strip() because it's implied in split().
Third of all, you should only split each line in the master file once. You are doing that for each line of input, which is bound to increase processing time a bit.
I am not entirely certain I understand your requirements from your code, but it seems to me something along these lines should help you:
import sys
from collections import defaultdict
master = defaultdict(list)
with open('Pt') as Pt:
for entry in Pt:
n, low, high = entry.split()
master[n].append(map(int, (low, high)))
with open('a') as a:
for line in a:
n, i = line.split()[:2]
for low, high in master[n]:
if low <= int(i) <= high:
sys.stdout.write(line)
break
To explain: First read and process all the data in the master file just once. Storing the master data in a defaultdict is handy here because it allows you to scan only the rows that matched the first column. map(int, ...) converts to ints.
When processing the input file, we can retrieve the ranges against which to compare the second value using the first value. Since master is a defaultdict(list), if there are no matches for the first column, we'll end up iterating an empty list.
Note that your original code using range() would have been equivalent to a condition
low <= i < high
You'll have to adjust the comparison operators as needed.
UPDATE oops. I put the break outside the condition. After fixing it I get the following three items:
chr1 1161693 chr1uGROUPERuDELu0u832 TGCTCTTTCCAGAAACCCTCAACCCTGTACGGTCAGGAGGAAACATGGCACCTCCCCTCTGGGG T 63 NormalSupport;MinSampleCount;LowSomaticScore CLUSTER_NUM=5454;CONTIG=GGTGCAGGGAAGCAGGAAGGAAGTGAAGCTCAAAAGCCCCTAGGACAGGGCACCTCCCCTCTGGATGCTCTTTCCAGAAACCCTCAACCTTGTACGGTCAGGAGAAAACACATCCCACAAG;CONTIG_NUM=5840;DOWNSTREAM=GCTCTTTCCAGAAACCCTCAACCCTGTACGGTCAGGAGAAAACACATCCCACAAG;END=1161756;NS=1;READSOURCES=(0:3:0,1:2:13);SOMATICSCORE=19;SVLEN=-63;SVTYPE=DEL;UPSTREAM=GGTGCAGGGAAGCGGGAAGGAAGTGAAGCTCAAAAGCCCCTAGGACAGGGCACCTCCCCTCTGGAT;ensembl_gene_id=ENSG00000078808 GT:GQ 1/.:.
chr1 158851689 chr1uGROUPERuDELu3u4452 GGGGAGTAATTCTTATTCATGATATGAAAACTCTAATGTGTTTCTTATTCCAGAAAA G 100 NormalSupport CLUSTER_NUM=25182;CONTIG=CATATTTTGCTATATCTCACATCATTGTTCATCTGATAATATATGAAAACTACAATGTGTTTCTTATTCCAGAAAGGGGAGTAATTCTTATTCATGAATAAACACTGAAGGAGAAAGATTATGGATCATAGTGGGAAAAGCCACAATACCATCTACATTC;CONTIG_NUM=24300;DOWNSTREAM=GGGAGTAATTCTTATTCATGAATAAACACTGACGGAGAAAGATTATGGATCATAGTGGGAAAAGCCACAATACCATCTACATTC;END=158851745;NS=1;READSOURCES=(0:11:0,1:3:18);SOMATICSCORE=55;SVLEN=-56;SVTYPE=DEL;UPSTREAM=CATATTTTGCTATATCTCACATCATTGTTCATCTGATAATATATGAAAACTCCAATGTGTTTCTTATTCCAGAAAG;ensembl_gene_id=ENSG00000229849 GT:GQ 1/.:.
chr1 165014865 chr1uGROUPERuDELu3u7344 ACTGGCATTAGCTATGCTTCCTTAGGCAGACAGCATGTTGAGAAATTCACATTCATCAG A 100 NormalSupport CLUSTER_NUM=40249;CONTIG=CTCCAGTAAAGAGCATCTTTTAATGAAGTGTATCTGCCTGGGCTAGAAAGGCAGCTGCCTCCACTAAAGCAGGGCTGGTCCAGAAATATTACCACTTGCCTAATCCTTATAGTAATCCTAACTGGCAGGTATTATTATATCCCAATTCACACACTTAGAGG;CONTIG_NUM=38845;DOWNSTREAM=CTTGCCTAATCCTTATAGTAATCCTAACTGGCAGGTATTATTATATCCCAATTCACACACTTAGAGG;END=165014923;NS=1;READSOURCES=(0:32:0,1:9:18);SOMATICSCORE=60;SVLEN=-58;SVTYPE=DEL;UPSTREAM=CTCCAGTAAAGAGCATCTTTTAATGAAGTGTATCTGCCTGGGCTAGAAAGGCAGCTGCCTCCACTAAAGCAGGGCTGGTCCAGAAATATTACCA GT:GQ 1/.:.
At least, don't do this:
row = row.strip().split()
f = range(int(row[1]),int(row[2]))
w=[]
print row[0]
if (line[0] == row[0]):
w.append(int(line[1]))
for i in w:
if (int(i) in f):
Instead:
f = int(row[1]), int(row[2])
...
if f[0] <= int(i) <= f[1]:
or similar.