Mercurial > repos > rliterman > csp2
comparison 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 |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
1 package clump; | |
2 | |
3 import java.util.ArrayList; | |
4 | |
5 import bloom.KCountArray; | |
6 import fileIO.ReadWrite; | |
7 import shared.Shared; | |
8 import stream.ConcurrentCollectionReadInputStream; | |
9 import stream.Read; | |
10 | |
11 /** | |
12 * @author Brian Bushnell | |
13 * @date Nov 12, 2015 | |
14 * | |
15 */ | |
16 public class ClumpTools { | |
17 | |
18 public static KCountArray table(){ | |
19 return table; | |
20 } | |
21 | |
22 public static synchronized KCountArray getTable(ArrayList<Read> reads, int k, int minCount){ | |
23 fname1=fname2=null; | |
24 table=null; | |
25 ConcurrentCollectionReadInputStream cris=new ConcurrentCollectionReadInputStream(reads, null, -1); | |
26 cris.start(); | |
27 table=PivotSet.makeKcaStatic(cris, k, minCount, Shared.AMINO_IN); | |
28 ReadWrite.closeStream(cris); | |
29 return table; | |
30 } | |
31 | |
32 public static synchronized KCountArray getTable(String fname1_, String fname2_, int k_, int minCount_){ | |
33 if(fname1==null || !fname1.equals(fname1_) || table==null){ | |
34 fname1=fname1_; | |
35 fname2=fname2_; | |
36 String[] args=new String[] {"in1="+fname1, "in2="+fname2, "k="+k_, "minCount="+minCount_}; | |
37 table=PivotSet.makeSet(args); | |
38 } | |
39 return table; | |
40 } | |
41 | |
42 public static synchronized void clearTable() { | |
43 fname1=fname2=null; | |
44 table=null; | |
45 } | |
46 | |
47 private static String fname1=null, fname2=null; | |
48 private static KCountArray table=null; | |
49 | |
50 } |