Purge old code

This commit is contained in:
eugenefischer
2022-09-28 13:40:13 -05:00
parent a88cfb8b0d
commit 882fbfffc6

View File

@@ -148,37 +148,7 @@ public class Plate {
return wells;
}
// //returns a map of the counts of the sequence at cell index sIndex, in all wells
// public void assayWellsSequenceS(Map<String, Integer> sequences, int... sIndices){
// this.assayWellsSequenceS(sequences, 0, size, sIndices);
// }
//
// //returns a map of the counts of the sequence at cell index sIndex, in a specific well
// public void assayWellsSequenceS(Map<String, Integer> sequences, int n, int... sIndices) {
// this.assayWellsSequenceS(sequences, n, n+1, sIndices);
// }
//
// //returns a map of the counts of the sequence at cell index sIndex, in a range of wells
// public void assayWellsSequenceS(Map<String, Integer> sequences, int start, int end, int... sIndices) {
// for(int sIndex: sIndices){
// for(int i = start; i < end; i++){
// countSequences(sequences, wells.get(i), sIndex);
// }
// }
// }
// //For the sequences at cell indices sIndices, counts number of unique sequences in the given well into the given map
// private void countSequences(Map<String, Integer> wellMap, List<String[]> well, int... sIndices) {
// for(String[] cell : well) {
// for(int sIndex: sIndices){
// //skip dropout sequences, which have value -1
// if(!"-1".equals(cell[sIndex])){
// wellMap.merge(cell[sIndex], 1, (oldValue, newValue) -> oldValue + newValue);
// }
// }
// }
// }
//For the sequences at cell indices sIndices, counts number of unique sequences in all well into the given map
//For the sequences at cell indices sIndices, counts number of unique sequences in all wells into the given map
public Map<String, SequenceRecord> countSequences(Integer readDepth, Double readErrorRate,
Double errorCollisionRate, int... sIndices) {
SequenceType[] sequenceTypes = EnumSet.allOf(SequenceType.class).toArray(new SequenceType[0]);
@@ -231,98 +201,6 @@ public class Plate {
return sequenceMap;
}
// //returns a map of the counts of the sequence at cell index sIndex, in all wells
// //Simulates read depth and read errors, counts the number of reads of a unique sequence into the given map.
// public void assayWellsSequenceSWithReadDepth(Map<String, Integer> misreadCounts, Map<String, Integer> occupancyMap, Map<String, Integer> readCountMap,
// int readDepth, double readErrorProb, double errorCollisionProb, int... sIndices) {
// this.assayWellsSequenceSWithReadDepth(misreadCounts, occupancyMap, readCountMap, readDepth, readErrorProb, errorCollisionProb, 0, size, sIndices);
// }
// //returns a map of the counts of the sequence at cell index sIndex, in a specific of wells
// //Simulates read depth and read errors, counts the number of reads of a unique sequence into the given map.
// public void assayWellsSequenceSWithReadDepth(Map<String, Integer> misreadCounts, Map<String, Integer> occupancyMap, Map<String, Integer> readCountMap,
// int readDepth, double readErrorProb, double errorCollisionProb,
// int n, int... sIndices) {
// this.assayWellsSequenceSWithReadDepth(misreadCounts, occupancyMap, readCountMap, readDepth, readErrorProb, errorCollisionProb, n, n+1, sIndices);
// }
//
// //returns a map of the counts of the sequence at cell index sIndex, in a range of wells
// //Simulates read depth and read errors, counts the number of reads of a unique sequence into the given map.
// public void assayWellsSequenceSWithReadDepth(Map<String, Integer> misreadCounts, Map<String, Integer> occupancyMap, Map<String, Integer> readCountMap,
// int readDepth, double readErrorProb, double errorCollisionProb,
// int start, int end, int... sIndices) {
// for(int sIndex: sIndices){
// for(int i = start; i < end; i++){
// countSequencesWithReadDepth(misreadCounts, occupancyMap, readCountMap, readDepth, readErrorProb, errorCollisionProb, wells.get(i), sIndex);
// }
// }
// }
//
// //For the sequences at cell indices sIndices, counts number of unique sequences in the given well into the given map
// //Simulates read depth and read errors, counts the number of reads of a unique sequence into the given map.
// //NOTE: this function changes the content of the well, adding spurious cells to contain the misread sequences
// //(this is necessary because, in the simulation, the plate is read multiple times, but random misreads can only
// //be simulated once).
// //(Possibly I should refactor all of this to only require a single plate assay, to speed things up. Or at least
// //to see if it would speed things up.)
// private void countSequencesWithReadDepth(Map<String, Integer> distinctMisreadCounts, Map<String, Integer> occupancyMap, Map<String, Integer> readCountMap,
// int readDepth, double readErrorProb, double errorCollisionProb,
// List<String[]> well, int... sIndices) {
// //list of spurious cells to add to well after counting
// List<String[]> spuriousCells = new ArrayList<>();
// for(String[] cell : well) {
// //new potential spurious cell for each cell that gets read
// String[] spuriousCell = new String[SequenceType.values().length];
// //initialize spurious cell with all dropout sequences
// Arrays.fill(spuriousCell, "-1");
// //has a read error occurred?
// boolean readError = false;
// for(int sIndex: sIndices){
// //skip dropout sequences, which have value "-1"
// if(!"-1".equals(cell[sIndex])){
// Map<String, Integer> sequencesWithReadCounts = new LinkedHashMap<>();
// for(int i = 0; i < readDepth; i++) {
// if (rand.nextDouble() <= readErrorProb) {
// readError = true;
// //Read errors are represented by appending "*"s to the end of the sequence some number of times
// StringBuilder spurious = new StringBuilder(cell[sIndex]);
// //if this sequence hasn't been misread before, or the read error is unique,
// //append one more "*" than has been appended before
// if (!distinctMisreadCounts.containsKey(cell[sIndex]) || rand.nextDouble() > errorCollisionProb) {
// distinctMisreadCounts.merge(cell[sIndex], 1, (oldValue, newValue) -> oldValue + newValue);
// for (int j = 0; j < distinctMisreadCounts.get(cell[sIndex]); j++) {
// spurious.append("*");
// }
// }
// //if this is a read error collision, randomly choose a number of "*"s that has been appended before
// else {
// int starCount = rand.nextInt(distinctMisreadCounts.get(cell[sIndex]));
// for (int j = 0; j < starCount; j++) {
// spurious.append("*");
// }
// }
// sequencesWithReadCounts.merge(spurious.toString(), 1, (oldValue, newValue) -> oldValue + newValue);
// //add spurious sequence to spurious cell
// spuriousCell[sIndex] = spurious.toString();
// }
// else {
// sequencesWithReadCounts.merge(cell[sIndex], 1, (oldValue, newValue) -> oldValue + newValue);
// }
// }
// for(String seq : sequencesWithReadCounts.keySet()) {
// occupancyMap.merge(seq, 1, (oldValue, newValue) -> oldValue + newValue);
// readCountMap.merge(seq, sequencesWithReadCounts.get(seq), (oldValue, newValue) -> oldValue + newValue);
// }
// }
// }
// if (readError) { //only add a new spurious cell if there was a read error
// spuriousCells.add(spuriousCell);
// }
// }
// //add all spurious cells to the well
// well.addAll(spuriousCells);
// }
public String getSourceFileName() {
return sourceFile;
}