use of gridss.filter.ClippedReadFilter in project gridss by PapenfussLab.
the class ExtractSVReads method setup.
@Override
protected void setup(SAMFileHeader header, File samFile) {
if (METRICS_OUTPUT != null) {
metricsCollector = new CollectStructuralVariantReadMetrics();
copyInput(metricsCollector);
metricsCollector.OUTPUT = METRICS_OUTPUT;
metricsCollector.setup(header, samFile);
}
SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
if (header.getSortOrder() != SortOrder.queryname) {
log.info("Not considering multiple read alignments as the input file is not queryname sorted.");
}
tmpoutput = gridss.Defaults.OUTPUT_TO_TEMP_FILE ? FileSystemContext.getWorkingFileFor(OUTPUT, "gridss.tmp.ExtractSVReads.") : OUTPUT;
writer = writerFactory.makeSAMOrBAMWriter(header, true, tmpoutput);
IndelReadFilter indelFilter = new IndelReadFilter(INDELS ? MIN_INDEL_SIZE : Integer.MAX_VALUE);
ClippedReadFilter softClipFilter = new ClippedReadFilter(CLIPPED ? MIN_CLIP_LENGTH : Integer.MAX_VALUE);
SplitReadFilter splitReadFilter = new SplitReadFilter();
AlignedFilter unmappedFilter = new AlignedFilter(false);
OneEndAnchoredReadFilter oeaFilter = new OneEndAnchoredReadFilter();
ReadPairConcordanceFilter dpFilter = getReadPairConcordanceCalculator() != null ? new ReadPairConcordanceFilter(getReadPairConcordanceCalculator(), false, true) : null;
List<SamRecordFilter> readfilters = new ArrayList<>();
readfilters.add(indelFilter);
readfilters.add(softClipFilter);
if (SPLIT)
readfilters.add(splitReadFilter);
if (UNMAPPED_READS)
readfilters.add(unmappedFilter);
readfilter = new UnionAggregateFilter(readfilters);
List<SamRecordFilter> pairfilters = new ArrayList<>();
if (SINGLE_MAPPED_PAIRED)
pairfilters.add(oeaFilter);
if (dpFilter != null && DISCORDANT_READ_PAIRS)
pairfilters.add(dpFilter);
pairfilter = new UnionAggregateFilter(pairfilters);
if (!SINGLE_MAPPED_PAIRED && !DISCORDANT_READ_PAIRS) {
pairfilter = new FixedFilter(true);
}
count = 0;
}
use of gridss.filter.ClippedReadFilter in project gridss by PapenfussLab.
the class CollectStructuralVariantReadMetrics method setup.
@Override
public void setup(SAMFileHeader header, File samFile) {
indelFilter = new IndelReadFilter(MIN_INDEL_SIZE);
softClipFilter = new ClippedReadFilter(MIN_CLIP_LENGTH);
splitReadFilter = new SplitReadFilter();
unmappedFilter = new AlignedFilter(false);
oeaFilter = new OneEndAnchoredReadFilter();
dpFilter = getReadPairConcordanceCalculator() != null ? new ReadPairConcordanceFilter(getReadPairConcordanceCalculator(), false, true) : null;
metrics = new StructuralVariantReadMetrics();
}
Aggregations