-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
formats: add FastQC support from opencga, #187
- Loading branch information
Showing
9 changed files
with
888 additions
and
0 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
biodata-formats/src/main/java/org/opencb/biodata/formats/sequence/fastqc/AdapterContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package org.opencb.biodata.formats.sequence.fastqc; | ||
|
||
public class AdapterContent { | ||
// #Position Illumina Universal Adapter Illumina Small RNA 3' Adapter Illumina Small RNA 5' Adapter Nextera Transposase Sequence SOLID Small RNA Adapter | ||
|
||
private String position; | ||
private double illumina; | ||
private double illumina3; | ||
private double illumina5; | ||
private double nextera; | ||
private double solid; | ||
|
||
public AdapterContent() { | ||
} | ||
|
||
public AdapterContent(String position, double illumina, double illumina3, double illumina5, double nextera, double solid) { | ||
this.position = position; | ||
this.illumina = illumina; | ||
this.illumina3 = illumina3; | ||
this.illumina5 = illumina5; | ||
this.nextera = nextera; | ||
this.solid = solid; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("AdapterContent{"); | ||
sb.append("position='").append(position).append('\''); | ||
sb.append(", illumina=").append(illumina); | ||
sb.append(", illumina3=").append(illumina3); | ||
sb.append(", illumina5=").append(illumina5); | ||
sb.append(", nextera=").append(nextera); | ||
sb.append(", solid=").append(solid); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
|
||
public String getPosition() { | ||
return position; | ||
} | ||
|
||
public AdapterContent setPosition(String position) { | ||
this.position = position; | ||
return this; | ||
} | ||
|
||
public double getIllumina() { | ||
return illumina; | ||
} | ||
|
||
public AdapterContent setIllumina(double illumina) { | ||
this.illumina = illumina; | ||
return this; | ||
} | ||
|
||
public double getIllumina3() { | ||
return illumina3; | ||
} | ||
|
||
public AdapterContent setIllumina3(double illumina3) { | ||
this.illumina3 = illumina3; | ||
return this; | ||
} | ||
|
||
public double getIllumina5() { | ||
return illumina5; | ||
} | ||
|
||
public AdapterContent setIllumina5(double illumina5) { | ||
this.illumina5 = illumina5; | ||
return this; | ||
} | ||
|
||
public double getNextera() { | ||
return nextera; | ||
} | ||
|
||
public AdapterContent setNextera(double nextera) { | ||
this.nextera = nextera; | ||
return this; | ||
} | ||
|
||
public double getSolid() { | ||
return solid; | ||
} | ||
|
||
public AdapterContent setSolid(double solid) { | ||
this.solid = solid; | ||
return this; | ||
} | ||
} |
194 changes: 194 additions & 0 deletions
194
biodata-formats/src/main/java/org/opencb/biodata/formats/sequence/fastqc/FastQc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
package org.opencb.biodata.formats.sequence.fastqc; | ||
|
||
import java.util.*; | ||
|
||
public class FastQc { | ||
|
||
private Summary summary; | ||
private Map<String, String> basicStats; | ||
private List<PerBaseSeqQuality> perBaseSeqQualities; | ||
private Map<Integer, Double> perSeqQualityScores; | ||
private List<PerTileSeqQuality> perTileSeqQuality; | ||
private List<PerBaseSeqContent> perBaseSeqContent; | ||
private double[] perSeqGcContent; | ||
private Map<String, Double> perBaseNContent; | ||
private Map<Integer, Double> seqLengthDistribution; | ||
private List<SeqDuplicationLevel> seqDuplicationLevels; | ||
private List<OverrepresentedSeq> overrepresentedSeqs; | ||
private List<AdapterContent> adapterContent; | ||
private List<KmerContent> kmerContent; | ||
|
||
public FastQc() { | ||
summary = new Summary(); | ||
basicStats = new LinkedHashMap<>(); | ||
perBaseSeqQualities = new LinkedList<>(); | ||
perSeqQualityScores = new LinkedHashMap<>(); | ||
perTileSeqQuality = new LinkedList<>(); | ||
perBaseSeqContent = new LinkedList<>(); | ||
perSeqGcContent = new double[101]; | ||
perBaseNContent = new LinkedHashMap<>(); | ||
seqLengthDistribution = new LinkedHashMap<>(); | ||
seqDuplicationLevels = new LinkedList<>(); | ||
overrepresentedSeqs = new LinkedList<>(); | ||
adapterContent = new LinkedList<>(); | ||
kmerContent = new LinkedList<>(); | ||
} | ||
|
||
public FastQc(Summary summary, Map<String, String> basicStats, List<PerBaseSeqQuality> perBaseSeqQualities, | ||
Map<Integer, Double> perSeqQualityScores, List<PerTileSeqQuality> perTileSeqQuality, | ||
List<PerBaseSeqContent> perBaseSeqContent, double[] perSeqGcContent, Map<String, Double> perBaseNContent, | ||
Map<Integer, Double> seqLengthDistribution, List<SeqDuplicationLevel> seqDuplicationLevels, | ||
List<OverrepresentedSeq> overrepresentedSeqs, List<AdapterContent> adapterContent, | ||
List<KmerContent> kmerContent) { | ||
this.summary = summary; | ||
this.basicStats = basicStats; | ||
this.perBaseSeqQualities = perBaseSeqQualities; | ||
this.perSeqQualityScores = perSeqQualityScores; | ||
this.perTileSeqQuality = perTileSeqQuality; | ||
this.perBaseSeqContent = perBaseSeqContent; | ||
this.perSeqGcContent = perSeqGcContent; | ||
this.perBaseNContent = perBaseNContent; | ||
this.seqLengthDistribution = seqLengthDistribution; | ||
this.seqDuplicationLevels = seqDuplicationLevels; | ||
this.overrepresentedSeqs = overrepresentedSeqs; | ||
this.adapterContent = adapterContent; | ||
this.kmerContent = kmerContent; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("FastQc{"); | ||
sb.append("summary=").append(summary); | ||
sb.append(", basicStats=").append(basicStats); | ||
sb.append(", perBaseSeqQualities=").append(perBaseSeqQualities); | ||
sb.append(", perSeqQualityScores=").append(perSeqQualityScores); | ||
sb.append(", perTileSeqQuality=").append(perTileSeqQuality); | ||
sb.append(", perBaseSeqContent=").append(perBaseSeqContent); | ||
sb.append(", perSeqGcContent=").append(Arrays.toString(perSeqGcContent)); | ||
sb.append(", perBaseNContent=").append(perBaseNContent); | ||
sb.append(", seqLengthDistribution=").append(seqLengthDistribution); | ||
sb.append(", seqDuplicationLevels=").append(seqDuplicationLevels); | ||
sb.append(", overrepresentedSeqs=").append(overrepresentedSeqs); | ||
sb.append(", adapterContent=").append(adapterContent); | ||
sb.append(", kmerContent=").append(kmerContent); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
|
||
public Summary getSummary() { | ||
return summary; | ||
} | ||
|
||
public FastQc setSummary(Summary summary) { | ||
this.summary = summary; | ||
return this; | ||
} | ||
|
||
public Map<String, String> getBasicStats() { | ||
return basicStats; | ||
} | ||
|
||
public FastQc setBasicStats(Map<String, String> basicStats) { | ||
this.basicStats = basicStats; | ||
return this; | ||
} | ||
|
||
public List<PerBaseSeqQuality> getPerBaseSeqQualities() { | ||
return perBaseSeqQualities; | ||
} | ||
|
||
public FastQc setPerBaseSeqQualities(List<PerBaseSeqQuality> perBaseSeqQualities) { | ||
this.perBaseSeqQualities = perBaseSeqQualities; | ||
return this; | ||
} | ||
|
||
public Map<Integer, Double> getPerSeqQualityScores() { | ||
return perSeqQualityScores; | ||
} | ||
|
||
public FastQc setPerSeqQualityScores(Map<Integer, Double> perSeqQualityScores) { | ||
this.perSeqQualityScores = perSeqQualityScores; | ||
return this; | ||
} | ||
|
||
public List<PerTileSeqQuality> getPerTileSeqQualities() { | ||
return perTileSeqQuality; | ||
} | ||
|
||
public FastQc setPerTileSeqQuality(List<PerTileSeqQuality> perTileSeqQuality) { | ||
this.perTileSeqQuality = perTileSeqQuality; | ||
return this; | ||
} | ||
|
||
public List<PerBaseSeqContent> getPerBaseSeqContent() { | ||
return perBaseSeqContent; | ||
} | ||
|
||
public FastQc setPerBaseSeqContent(List<PerBaseSeqContent> perBaseSeqContent) { | ||
this.perBaseSeqContent = perBaseSeqContent; | ||
return this; | ||
} | ||
|
||
public double[] getPerSeqGcContent() { | ||
return perSeqGcContent; | ||
} | ||
|
||
public FastQc setPerSeqGcContent(double[] perSeqGcContent) { | ||
this.perSeqGcContent = perSeqGcContent; | ||
return this; | ||
} | ||
|
||
public Map<String, Double> getPerBaseNContent() { | ||
return perBaseNContent; | ||
} | ||
|
||
public FastQc setPerBaseNContent(Map<String, Double> perBaseNContent) { | ||
this.perBaseNContent = perBaseNContent; | ||
return this; | ||
} | ||
|
||
public Map<Integer, Double> getSeqLengthDistribution() { | ||
return seqLengthDistribution; | ||
} | ||
|
||
public FastQc setSeqLengthDistribution(Map<Integer, Double> seqLengthDistribution) { | ||
this.seqLengthDistribution = seqLengthDistribution; | ||
return this; | ||
} | ||
|
||
public List<SeqDuplicationLevel> getSeqDuplicationLevels() { | ||
return seqDuplicationLevels; | ||
} | ||
|
||
public FastQc setSeqDuplicationLevels(List<SeqDuplicationLevel> seqDuplicationLevels) { | ||
this.seqDuplicationLevels = seqDuplicationLevels; | ||
return this; | ||
} | ||
|
||
public List<OverrepresentedSeq> getOverrepresentedSeqs() { | ||
return overrepresentedSeqs; | ||
} | ||
|
||
public FastQc setOverrepresentedSeqs(List<OverrepresentedSeq> overrepresentedSeqs) { | ||
this.overrepresentedSeqs = overrepresentedSeqs; | ||
return this; | ||
} | ||
|
||
public List<AdapterContent> getAdapterContent() { | ||
return adapterContent; | ||
} | ||
|
||
public FastQc setAdapterContent(List<AdapterContent> adapterContent) { | ||
this.adapterContent = adapterContent; | ||
return this; | ||
} | ||
|
||
public List<KmerContent> getKmerContent() { | ||
return kmerContent; | ||
} | ||
|
||
public FastQc setKmerContent(List<KmerContent> kmerContent) { | ||
this.kmerContent = kmerContent; | ||
return this; | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
biodata-formats/src/main/java/org/opencb/biodata/formats/sequence/fastqc/KmerContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package org.opencb.biodata.formats.sequence.fastqc; | ||
|
||
public class KmerContent { | ||
// #Sequence Count PValue Obs/Exp Max Max Obs/Exp Position | ||
|
||
private String sequence; | ||
private int count; | ||
private double pValue; | ||
private double obsExpMax; | ||
private String maxObsExpPosition; | ||
|
||
public KmerContent() { | ||
} | ||
|
||
public KmerContent(String sequence, int count, double pValue, double obsExpMax, String maxObsExpPosition) { | ||
this.sequence = sequence; | ||
this.count = count; | ||
this.pValue = pValue; | ||
this.obsExpMax = obsExpMax; | ||
this.maxObsExpPosition = maxObsExpPosition; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("KmerContent{"); | ||
sb.append("sequence='").append(sequence).append('\''); | ||
sb.append(", count=").append(count); | ||
sb.append(", pValue=").append(pValue); | ||
sb.append(", obsExpMax=").append(obsExpMax); | ||
sb.append(", maxObsExpPosition='").append(maxObsExpPosition).append('\''); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
|
||
public String getSequence() { | ||
return sequence; | ||
} | ||
|
||
public KmerContent setSequence(String sequence) { | ||
this.sequence = sequence; | ||
return this; | ||
} | ||
|
||
public int getCount() { | ||
return count; | ||
} | ||
|
||
public KmerContent setCount(int count) { | ||
this.count = count; | ||
return this; | ||
} | ||
|
||
public double getpValue() { | ||
return pValue; | ||
} | ||
|
||
public KmerContent setpValue(double pValue) { | ||
this.pValue = pValue; | ||
return this; | ||
} | ||
|
||
public double getObsExpMax() { | ||
return obsExpMax; | ||
} | ||
|
||
public KmerContent setObsExpMax(double obsExpMax) { | ||
this.obsExpMax = obsExpMax; | ||
return this; | ||
} | ||
|
||
public String getMaxObsExpPosition() { | ||
return maxObsExpPosition; | ||
} | ||
|
||
public KmerContent setMaxObsExpPosition(String maxObsExpPosition) { | ||
this.maxObsExpPosition = maxObsExpPosition; | ||
return this; | ||
} | ||
} |
Oops, something went wrong.