Refactor sequences to be strings instead of integers, to make simulating read errors easier

This commit is contained in:
eugenefischer
2022-09-26 13:37:48 -05:00
parent f84dfb2b4b
commit 02c8e6aacb
10 changed files with 101 additions and 115 deletions

View File

@@ -5,7 +5,7 @@ import java.util.stream.IntStream;
public class CellSample {
private List<Integer[]> cells;
private List<String[]> cells;
private Integer cdr1Freq;
public CellSample(Integer numDistinctCells, Integer cdr1Freq){
@@ -24,28 +24,28 @@ public class CellSample {
//Each cell represented by 4 values
//two CDR3s, and two CDR1s. First two values are CDR3s (alpha, beta), second two are CDR1s (alpha, beta)
List<Integer[]> distinctCells = new ArrayList<>();
List<String[]> distinctCells = new ArrayList<>();
for(int i = 0; i < numbersCDR3.size() - 1; i = i + 2){
//Go through entire CDR3 list once, make pairs of alphas and betas
Integer tmpCDR3a = numbersCDR3.get(i);
Integer tmpCDR3b = numbersCDR3.get(i+1);
//Go through (likely shorter) CDR1 list as many times as necessary, make pairs of alphas and betas
Integer tmpCDR1a = numbersCDR1.get(i % numbersCDR1.size());
Integer tmpCDR1b = numbersCDR1.get((i+1) % numbersCDR1.size());
String tmpCDR3a = numbersCDR3.get(i).toString();
String tmpCDR3b = numbersCDR3.get(i+1).toString();
//Go through the (likely shorter) CDR1 list as many times as necessary, make pairs of alphas and betas
String tmpCDR1a = numbersCDR1.get(i % numbersCDR1.size()).toString();
String tmpCDR1b = numbersCDR1.get((i+1) % numbersCDR1.size()).toString();
//Make the array representing the cell
Integer[] tmp = {tmpCDR3a, tmpCDR3b, tmpCDR1a, tmpCDR1b};
String[] tmp = {tmpCDR3a, tmpCDR3b, tmpCDR1a, tmpCDR1b};
//Add the cell to the list of distinct cells
distinctCells.add(tmp);
}
this.cells = distinctCells;
}
public CellSample(List<Integer[]> cells, Integer cdr1Freq){
public CellSample(List<String[]> cells, Integer cdr1Freq){
this.cells = cells;
this.cdr1Freq = cdr1Freq;
}
public List<Integer[]> getCells(){
public List<String[]> getCells(){
return cells;
}