diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 332001c..da53a9b 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -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 @@ -632,7 +634,7 @@ command-line options: --col-reference reference file for column barcodes (i.e., conditions) --umi-reference --global-reference - --row-reads required if reads are split between two files + --row-reads required if reads are split between two files or for demultiplexed data --rev-row-reads required for processing paired-end sequencing data --col-reads required if reads are split between two files --reads required if reads are contained in a single file diff --git a/project/build.properties b/project/build.properties index 3040987..2743082 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.4 +sbt.version=1.9.6 diff --git a/src/main/scala/org/broadinstitute/gpp/poolq3/PoolQConfig.scala b/src/main/scala/org/broadinstitute/gpp/poolq3/PoolQConfig.scala index b010663..138b76b 100644 --- a/src/main/scala/org/broadinstitute/gpp/poolq3/PoolQConfig.scala +++ b/src/main/scala/org/broadinstitute/gpp/poolq3/PoolQConfig.scala @@ -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), @@ -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")) } @@ -170,7 +175,7 @@ object PoolQConfig { val _ = opt[List[(Option[String], Path)]]("row-reads") .valueName("") .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") diff --git a/test-data/Makefile b/test-data/Makefile index 0b504bc..30b9754 100644 --- a/test-data/Makefile +++ b/test-data/Makefile @@ -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 && \