jpayne@68: package bloom; jpayne@68: jpayne@68: import java.util.ArrayList; jpayne@68: import java.util.Arrays; jpayne@68: jpayne@68: import dna.AminoAcid; jpayne@68: import fileIO.ReadWrite; jpayne@68: import shared.Timer; jpayne@68: import stream.ConcurrentGenericReadInputStream; jpayne@68: import stream.FastqReadInputStream; jpayne@68: import stream.Read; jpayne@68: import structures.ListNum; jpayne@68: jpayne@68: /** jpayne@68: * @author Brian Bushnell jpayne@68: * @date Jul 5, 2012 jpayne@68: * jpayne@68: */ jpayne@68: public class TestLargeKmer { jpayne@68: jpayne@68: public static void main(String args[]){ jpayne@68: Timer t=new Timer(); jpayne@68: jpayne@68: String fname1=args[0]; jpayne@68: String fname2=(args.length>4 || args[1].contains(".") ? args[1] : null); jpayne@68: int k=Integer.parseInt(args[args.length-3]); jpayne@68: int cbits=Integer.parseInt(args[args.length-2]); jpayne@68: int k2=Integer.parseInt(args[args.length-1]); jpayne@68: jpayne@68: KCountArray2 counts=KmerCount3.countFastq(fname1, fname2, k, cbits); jpayne@68: long[] counts2=countK2(fname1, fname2, k, counts, k2); jpayne@68: jpayne@68: t.stop(); jpayne@68: System.out.println("Finished counting; time = "+t+"\n"); jpayne@68: jpayne@68: for(int i=0; i=1 && k<20); jpayne@68: final int kbits=2*k; jpayne@68: final long mask=(kbits>63 ? -1L : ~((-1L)< ln=cris.nextList(); jpayne@68: ArrayList reads=(ln!=null ? ln.list : null); jpayne@68: jpayne@68: if(reads!=null && !reads.isEmpty()){ jpayne@68: Read r=reads.get(0); jpayne@68: assert(paired==(r.mate!=null)); jpayne@68: } jpayne@68: jpayne@68: while(ln!=null && reads!=null && reads.size()>0){//ln!=null prevents a compiler potential null access warning jpayne@68: //System.err.println("reads.size()="+reads.size()); jpayne@68: for(Read r : reads){ jpayne@68: jpayne@68: len=0; jpayne@68: kmer=0; jpayne@68: Arrays.fill(subcount, 0); jpayne@68: jpayne@68: byte[] bases=r.bases; jpayne@68: byte[] quals=r.quality; jpayne@68: for(int i=0; i=k){ jpayne@68: value=counts1.read(kmer); jpayne@68: } jpayne@68: } jpayne@68: value=min(value, maxValue); jpayne@68: jpayne@68: ring[ringpos]=value; jpayne@68: subcount[value]++; jpayne@68: jpayne@68: if(i>=ring.length){ jpayne@68: subcount[old]--; jpayne@68: } jpayne@68: jpayne@68: if(len>=k2){ jpayne@68: int sub=0; jpayne@68: while(sub=k){ jpayne@68: value=counts1.read(kmer); jpayne@68: } jpayne@68: } jpayne@68: value=min(value, maxValue); jpayne@68: jpayne@68: ring[ringpos]=value; jpayne@68: subcount[value]++; jpayne@68: jpayne@68: if(i>=ring.length){ jpayne@68: subcount[old]--; jpayne@68: } jpayne@68: jpayne@68: if(len>=k2){ jpayne@68: int sub=0; jpayne@68: while(suby ? x : y;} jpayne@68: jpayne@68: public static final int BOUND_LEN=256; jpayne@68: jpayne@68: }