Ejemplo n.º 1
0
    def test_checkReferencePath(self):
        """Test checkReferencePath()."""
        refDir = "/pbi/dept/secondary/siv/references/"
        refPath = path.join(refDir, "lambda")
        refPath, refFastaOut, refSaOut, isWithinRepository, annotation = \
            checkReferencePath(refPath)
        self.assertTrue(
            filecmp.cmp(refFastaOut, path.join(refPath,
                                               "sequence/lambda.fasta")))
        self.assertTrue(
            filecmp.cmp(refSaOut, path.join(refPath,
                                            "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)

        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(refFastaOut)
        self.assertTrue(
            filecmp.cmp(refFastaOut, path.join(refPath,
                                               "sequence/lambda.fasta")))
        self.assertTrue(
            filecmp.cmp(refSaOut, path.join(refPath,
                                            "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)

        fastaFN = "{0}/data/ecoli.fasta".format(self.rootDir)

        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(fastaFN)
        self.assertTrue(filecmp.cmp(refpath, refFastaOut))
        self.assertIsNone(refSaOut)
        self.assertFalse(isWithinRepository)

        refPathWithAnnotation = path.join(DATA_DIR, "references/H1_6_Scal_6x/")
        _refPath, _refFaOut, _refSaOut, _isWithinRepository, annotation = \
            checkReferencePath(refPathWithAnnotation)
        self.assertEqual(
            path.abspath(annotation),
            path.abspath(
                path.join(refPathWithAnnotation,
                          "annotations/H1_6_Scal_6x_adapters.gff")))

        xmlFN = path.join(self.rootDir, "data/reference_lambda.xml")
        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(xmlFN)
        self.assertTrue(
            filecmp.cmp(
                refFastaOut,
                "/pbi/dept/secondary/siv/testdata/pbalign-unittest/data/lambda_ref.fasta"
            ))
Ejemplo n.º 2
0
    def test_checkReferencePath(self):
        """Test checkReferencePath()."""
        refDir = "/pbi/dept/secondary/siv/references/"
        refPath = path.join(refDir, "lambda")
        refPath, refFastaOut, refSaOut, isWithinRepository, annotation = \
            checkReferencePath(refPath)
        self.assertTrue(filecmp.cmp(refFastaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta")))
        self.assertTrue(filecmp.cmp(refSaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)

        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(refFastaOut)
        self.assertTrue(filecmp.cmp(refFastaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta")))
        self.assertTrue(filecmp.cmp(refSaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)

        fastaFN = "{0}/data/ecoli.fasta".format(self.rootDir)

        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(fastaFN)
        self.assertTrue(filecmp.cmp(refpath, refFastaOut))
        self.assertIsNone(refSaOut)
        self.assertFalse(isWithinRepository)

        refPathWithAnnotation = path.join(DATA_DIR, "references/H1_6_Scal_6x/")
        _refPath, _refFaOut, _refSaOut, _isWithinRepository, annotation = \
            checkReferencePath(refPathWithAnnotation)
        self.assertEqual(path.abspath(annotation),
            path.abspath(path.join(refPathWithAnnotation,
            "annotations/H1_6_Scal_6x_adapters.gff")))

        xmlFN = path.join(self.rootDir,  "data/reference_lambda.xml")
        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(xmlFN)
        self.assertTrue(filecmp.cmp(refFastaOut,
            "/pbi/dept/secondary/siv/testdata/pbalign-unittest/data/lambda_ref.fasta"))
Ejemplo n.º 3
0
    def test_checkReferencePath(self):
        """Test checkReferencePath()."""
        refDir = "/mnt/secondary/Smrtanalysis/opt/smrtanalysis/common/" + \
            "references"
        refPath = path.join(refDir, "lambda")
        refPath, refFastaOut, refSaOut, isWithinRepository, annotation = \
            checkReferencePath(refPath)
        self.assertTrue(filecmp.cmp(refFastaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta")))
        self.assertTrue(filecmp.cmp(refSaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)

        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(refFastaOut)
        self.assertTrue(filecmp.cmp(refFastaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta")))
        self.assertTrue(filecmp.cmp(refSaOut,
                                    path.join(refPath,
                                              "sequence/lambda.fasta.sa")))
        self.assertTrue(isWithinRepository)


        fastaFN = "{0}/data/ecoli.fasta".format(self.rootDir)
        refpath, refFastaOut, refSaOut, isWithinRepository, annotation = \
                checkReferencePath(fastaFN)
        self.assertTrue(filecmp.cmp(refpath, refFastaOut))
        self.assertIsNone(refSaOut)
        self.assertFalse(isWithinRepository)

        refPathWithAnnotation = "/mnt/secondary-siv/" + \
            "testdata/BlasrTestData/pbalign/data/references/H1_6_Scal_6x/"
        _refPath, _refFaOut, _refSaOut, _isWithinRepository, annotation = \
            checkReferencePath(refPathWithAnnotation)
        self.assertEqual(path.abspath(annotation),
            path.abspath(path.join(refPathWithAnnotation,
            "annotations/H1_6_Scal_6x_adapters.gff")))
Ejemplo n.º 4
0
 def SetReferencePath(self, referencePath):
     """Validate the user-specified referencePath and get the absolute
     and expanded path for referencePath, targetFileName and
     sawriterFileName. targetFileName is the target reference FASTA
     file to be used by an aligner. sawriterFileName is the reference
     sawriter file that can be used by an aligner (e.g. blasr), its
     value can be None if absent.
     """
     if referencePath is not None and referencePath != "":
         (self.referencePath, self.targetFileName,
          self.sawriterFileName, self.isWithinRepository,
          self.adapterGffFileName) = \
         checkReferencePath(referencePath)
Ejemplo n.º 5
0
 def SetReferencePath(self, referencePath):
     """Validate the user-specified referencePath and get the absolute
     and expanded path for referencePath, targetFileName and
     sawriterFileName. targetFileName is the target reference FASTA
     file to be used by an aligner. sawriterFileName is the reference
     sawriter file that can be used by an aligner (e.g. blasr), its
     value can be None if absent.
     """
     if referencePath is not None and referencePath != "":
         (self.referencePath, self.targetFileName,
          self.sawriterFileName, self.isWithinRepository,
          self.adapterGffFileName) = \
         checkReferencePath(referencePath)