Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/current/clump/ClumpTools.java @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@68 | 1 package clump; |
jpayne@68 | 2 |
jpayne@68 | 3 import java.util.ArrayList; |
jpayne@68 | 4 |
jpayne@68 | 5 import bloom.KCountArray; |
jpayne@68 | 6 import fileIO.ReadWrite; |
jpayne@68 | 7 import shared.Shared; |
jpayne@68 | 8 import stream.ConcurrentCollectionReadInputStream; |
jpayne@68 | 9 import stream.Read; |
jpayne@68 | 10 |
jpayne@68 | 11 /** |
jpayne@68 | 12 * @author Brian Bushnell |
jpayne@68 | 13 * @date Nov 12, 2015 |
jpayne@68 | 14 * |
jpayne@68 | 15 */ |
jpayne@68 | 16 public class ClumpTools { |
jpayne@68 | 17 |
jpayne@68 | 18 public static KCountArray table(){ |
jpayne@68 | 19 return table; |
jpayne@68 | 20 } |
jpayne@68 | 21 |
jpayne@68 | 22 public static synchronized KCountArray getTable(ArrayList<Read> reads, int k, int minCount){ |
jpayne@68 | 23 fname1=fname2=null; |
jpayne@68 | 24 table=null; |
jpayne@68 | 25 ConcurrentCollectionReadInputStream cris=new ConcurrentCollectionReadInputStream(reads, null, -1); |
jpayne@68 | 26 cris.start(); |
jpayne@68 | 27 table=PivotSet.makeKcaStatic(cris, k, minCount, Shared.AMINO_IN); |
jpayne@68 | 28 ReadWrite.closeStream(cris); |
jpayne@68 | 29 return table; |
jpayne@68 | 30 } |
jpayne@68 | 31 |
jpayne@68 | 32 public static synchronized KCountArray getTable(String fname1_, String fname2_, int k_, int minCount_){ |
jpayne@68 | 33 if(fname1==null || !fname1.equals(fname1_) || table==null){ |
jpayne@68 | 34 fname1=fname1_; |
jpayne@68 | 35 fname2=fname2_; |
jpayne@68 | 36 String[] args=new String[] {"in1="+fname1, "in2="+fname2, "k="+k_, "minCount="+minCount_}; |
jpayne@68 | 37 table=PivotSet.makeSet(args); |
jpayne@68 | 38 } |
jpayne@68 | 39 return table; |
jpayne@68 | 40 } |
jpayne@68 | 41 |
jpayne@68 | 42 public static synchronized void clearTable() { |
jpayne@68 | 43 fname1=fname2=null; |
jpayne@68 | 44 table=null; |
jpayne@68 | 45 } |
jpayne@68 | 46 |
jpayne@68 | 47 private static String fname1=null, fname2=null; |
jpayne@68 | 48 private static KCountArray table=null; |
jpayne@68 | 49 |
jpayne@68 | 50 } |