Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rational args #25

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ You can also test them individually by running:
% (cd test-data; make test-scenario6)
% (cd test-data; make test-long-template)
% (cd test-data; make test-paired-end)
% (cd test-data; make test-demultiplexed)
% (cd test-data; make test-demultiplexed-paired-end)

## Recommended JVM Settings

Expand Down Expand Up @@ -632,7 +634,7 @@ command-line options:
--col-reference <file> reference file for column barcodes (i.e., conditions)
--umi-reference <file>
--global-reference <file>
--row-reads <files> required if reads are split between two files
--row-reads <files> required if reads are split between two files or for demultiplexed data
--rev-row-reads <files> required for processing paired-end sequencing data
--col-reads <files> required if reads are split between two files
--reads <files> required if reads are contained in a single file
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.4
sbt.version=1.9.6
11 changes: 8 additions & 3 deletions src/main/scala/org/broadinstitute/gpp/poolq3/PoolQConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ final case class PoolQInput(
def readsSourceE: Either[Exception, ReadsSource] = (rowReads, reverseRowReads, colReads, reads, demultiplexed) match {
case (None, None, None, Some(r), false) =>
Right(ReadsSource.SelfContained(Nel(r._2, addlReads.view.map(_._2).toList)))

case (Some(rr), None, Some(cr), None, false) =>
val rs = ReadsSource.Split(Nel(cr, addlColReads), Nel(rr._2, addlRowReads.view.map(_._2).toList))
if (rs.forward.length == rs.index.length) Right(rs)
else Left(PoolQException("Number of row, column, and reverse reads files must match"))

case (Some(rr), Some(rrr), Some(cr), None, false) =>
val rs = ReadsSource.PairedEnd(
Nel(cr, addlColReads),
Expand All @@ -51,12 +53,15 @@ final case class PoolQInput(
)
if (rs.forward.length == rs.index.length && rs.forward.length == rs.reverse.length) Right(rs)
else Left(PoolQException("Number of row and column reads files must match"))
case (None, None, None, Some(r), true) =>
Right(ReadsSource.Dmuxed(Nel(r, addlReads)))

case (Some(rr), None, None, None, true) =>
Right(ReadsSource.Dmuxed(Nel(rr, addlRowReads)))

case (Some(rr), Some(rrr), None, None, true) =>
val rs = ReadsSource.DmuxedPairedEnd(Nel(rr, addlRowReads), Nel(rrr, addlReverseRowReads))
if (rs.read1.map(_._1) == rs.read2.map(_._1)) Right(rs)
else Left(PoolQException("Row and column reads files must match"))

case _ => Left(PoolQException("Conflicting input options"))
}

Expand Down Expand Up @@ -170,7 +175,7 @@ object PoolQConfig {
val _ = opt[List[(Option[String], Path)]]("row-reads")
.valueName("<files>")
.action { case (ps, c) => c.copy(input = c.input.copy(rowReads = ps.headOption, addlRowReads = ps.drop(1))) }
.text("required if reads are split between two files")
.text("required if reads are split between two files or for demultiplexed data")
.validate(_.view.map(_._2).toList.traverse_(existsAndIsReadable))

val _ = opt[List[(Option[String], Path)]]("rev-row-reads")
Expand Down
2 changes: 1 addition & 1 deletion test-data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ test-demultiplexed:
--col-reference $(conditions) \
--row-reference $(reference) \
--demultiplexed \
--reads TTGAACCG:../../test-data/demultiplexed/TTGAACCG.construct.fastq,CCGAGTTA:../../test-data/demultiplexed/CCGAGTTA.construct.fastq,TTGAGTAT:../../test-data/demultiplexed/TTGAGTAT.construct.fastq,CCTCCAAT:../../test-data/demultiplexed/CCTCCAAT.construct.fastq,GGTCACCG:../../test-data/demultiplexed/GGTCACCG.construct.fastq,TTGACAAT:../../test-data/demultiplexed/TTGACAAT.construct.fastq,AATCCAAT:../../test-data/demultiplexed/AATCCAAT.construct.fastq,TTCTCATA:../../test-data/demultiplexed/TTCTCATA.construct.fastq,AATCCACG:../../test-data/demultiplexed/AATCCACG.construct.fastq,AATCGTGC:../../test-data/demultiplexed/AATCGTGC.construct.fastq,AAGAACTA:../../test-data/demultiplexed/AAGAACTA.construct.fastq,CCAGTGAT:../../test-data/demultiplexed/CCAGTGAT.construct.fastq,GGTCGTGC:../../test-data/demultiplexed/GGTCGTGC.construct.fastq,TTAGACCG:../../test-data/demultiplexed/TTAGACCG.construct.fastq,GGTCCACG:../../test-data/demultiplexed/GGTCCACG.construct.fastq,CCGAACTA:../../test-data/demultiplexed/CCGAACTA.construct.fastq,AACTCACG:../../test-data/demultiplexed/AACTCACG.construct.fastq,AATCACTA:../../test-data/demultiplexed/AATCACTA.construct.fastq,GGTCCATA:../../test-data/demultiplexed/GGTCCATA.construct.fastq,GGTCTGCG:../../test-data/demultiplexed/GGTCTGCG.construct.fastq,CCAGTGGC:../../test-data/demultiplexed/CCAGTGGC.construct.fastq,AACTTGCG:../../test-data/demultiplexed/AACTTGCG.construct.fastq,../../test-data/demultiplexed/unmatched.construct.fastq \
--row-reads TTGAACCG:../../test-data/demultiplexed/TTGAACCG.construct.fastq,CCGAGTTA:../../test-data/demultiplexed/CCGAGTTA.construct.fastq,TTGAGTAT:../../test-data/demultiplexed/TTGAGTAT.construct.fastq,CCTCCAAT:../../test-data/demultiplexed/CCTCCAAT.construct.fastq,GGTCACCG:../../test-data/demultiplexed/GGTCACCG.construct.fastq,TTGACAAT:../../test-data/demultiplexed/TTGACAAT.construct.fastq,AATCCAAT:../../test-data/demultiplexed/AATCCAAT.construct.fastq,TTCTCATA:../../test-data/demultiplexed/TTCTCATA.construct.fastq,AATCCACG:../../test-data/demultiplexed/AATCCACG.construct.fastq,AATCGTGC:../../test-data/demultiplexed/AATCGTGC.construct.fastq,AAGAACTA:../../test-data/demultiplexed/AAGAACTA.construct.fastq,CCAGTGAT:../../test-data/demultiplexed/CCAGTGAT.construct.fastq,GGTCGTGC:../../test-data/demultiplexed/GGTCGTGC.construct.fastq,TTAGACCG:../../test-data/demultiplexed/TTAGACCG.construct.fastq,GGTCCACG:../../test-data/demultiplexed/GGTCCACG.construct.fastq,CCGAACTA:../../test-data/demultiplexed/CCGAACTA.construct.fastq,AACTCACG:../../test-data/demultiplexed/AACTCACG.construct.fastq,AATCACTA:../../test-data/demultiplexed/AATCACTA.construct.fastq,GGTCCATA:../../test-data/demultiplexed/GGTCCATA.construct.fastq,GGTCTGCG:../../test-data/demultiplexed/GGTCTGCG.construct.fastq,CCAGTGGC:../../test-data/demultiplexed/CCAGTGGC.construct.fastq,AACTTGCG:../../test-data/demultiplexed/AACTTGCG.construct.fastq,../../test-data/demultiplexed/unmatched.construct.fastq \
--row-barcode-policy PREFIX:CACCG@18)
(cd $(wd); diff counts.txt ../../test-data/expected-counts.txt && \
diff lognormalized-counts.txt ../../test-data/lognormalized-counts.txt && \
Expand Down