Beispiel #1
0
    def test_checkInputFile(self):
        """Test checkInputFile()."""
        fastaFN = "{0}/data/ecoli.fasta".format(self.rootDir)
        plsFN = "/home/UNIXHOME/yli/yliWorkspace/private/yli/" + \
                "data/testLoadPulses/m121215_065521_richard_" + \
                "c100425710150000001823055001121371_s1_p0.pls.h5"
        self.assertTrue(filecmp.cmp(fastaFN, checkInputFile(fastaFN)))
        self.assertTrue(filecmp.cmp(plsFN, checkInputFile(plsFN)))

        fofnFN = "{0}/data/ecoli_lp.fofn".format(self.rootDir)
        self.assertTrue(filecmp.cmp(fofnFN, checkInputFile(fofnFN)))
Beispiel #2
0
    def SetPulseFileName(self, inputFileName, pulseFileName):
        """Verify and assign the pulse file from which pulses can be
        extracted. When inputFileName is a Base/Pulse/CCS.H5 file or a
        fofn of Base/Pulse/CCS.H5, pulse file is inputFileName. Otherwise,
        pulse file is pulseFileName."""
        self.pulseFileName = None
        if inputFileName is not None and inputFileName != "":
            inputFormat = getRealFileFormat(inputFileName)
            if inputFormat in [FILE_FORMATS.BAS, FILE_FORMATS.BAX,
                    FILE_FORMATS.PLS, FILE_FORMATS.PLX, FILE_FORMATS.CCS]:
                self.pulseFileName = checkInputFile(inputFileName)

        if self.pulseFileName is None:
            if pulseFileName is not None and pulseFileName != "":
                self.pulseFileName = checkInputFile(pulseFileName)
Beispiel #3
0
    def SetPulseFileName(self, inputFileName, pulseFileName):
        """Verify and assign the pulse file from which pulses can be
        extracted. When inputFileName is a Base/Pulse/CCS.H5 file or a
        fofn of Base/Pulse/CCS.H5, pulse file is inputFileName. Otherwise,
        pulse file is pulseFileName."""
        self.pulseFileName = None
        if inputFileName is not None and inputFileName != "":
            inputFormat = getRealFileFormat(inputFileName)
            if inputFormat in [FILE_FORMATS.BAS, FILE_FORMATS.BAX,
                    FILE_FORMATS.PLS, FILE_FORMATS.PLX, FILE_FORMATS.CCS]:
                self.pulseFileName = checkInputFile(inputFileName)

        if self.pulseFileName is None:
            if pulseFileName is not None and pulseFileName != "":
                self.pulseFileName = checkInputFile(pulseFileName)
Beispiel #4
0
 def SetInputFile(self, inputFileName):
     """Verify and assign input file name and input file format."""
     # Validate the user-specified input PacBio read file and get
     # the absolute and expanded path. Validate file format.
     if inputFileName is not None and inputFileName != "":
         self.inputFileName = checkInputFile(inputFileName)
         self.inputFileFormat = getRealFileFormat(self.inputFileName)
Beispiel #5
0
 def SetInputFile(self, inputFileName):
     """Verify and assign input file name and input file format."""
     # Validate the user-specified input PacBio read file and get
     # the absolute and expanded path. Validate file format.
     if inputFileName is not None and inputFileName != "":
         self.inputFileName = checkInputFile(inputFileName)
         self.inputFileFormat = getRealFileFormat(self.inputFileName)
Beispiel #6
0
    def test_checkInputFile(self):
        """Test checkInputFile()."""
        fastaFN = path.join(self.rootDir,  "data/ecoli.fasta")
        plsFN = self.dataDir + \
                "m121215_065521_richard_c100425710150000001823055001121371_s1_p0.pls.h5"
        self.assertTrue(filecmp.cmp(fastaFN, checkInputFile(fastaFN)))
        self.assertTrue(filecmp.cmp(plsFN, checkInputFile(plsFN)))

        fofnFN = path.join(self.rootDir,  "data/ecoli_lp.fofn")
        self.assertTrue(filecmp.cmp(fofnFN, checkInputFile(fofnFN)))

        xmlFN = path.join(self.rootDir,  "data/subreads_dataset1.xml")
        ret = checkInputFile(xmlFN)
        self.assertTrue(ret.endswith('.xml'))
        fs = DataSet(ret).toExternalFiles()
        self.assertTrue(fs[0].endswith("m140905_042212_sidney_c100564852550000001823085912221377_s1_X0.1.subreads.bam"))
        self.assertTrue(fs[1].endswith("m130406_011850_42141_c100513442550000001823074308221310_s1_p0.1.subreads.bam"))
Beispiel #7
0
    def test_checkInputFile(self):
        """Test checkInputFile()."""
        fastaFN = path.join(self.rootDir, "data/ecoli.fasta")
        plsFN = self.dataDir + \
                "m121215_065521_richard_c100425710150000001823055001121371_s1_p0.pls.h5"
        self.assertTrue(filecmp.cmp(fastaFN, checkInputFile(fastaFN)))
        self.assertTrue(filecmp.cmp(plsFN, checkInputFile(plsFN)))

        fofnFN = path.join(self.rootDir, "data/ecoli_lp.fofn")
        self.assertTrue(filecmp.cmp(fofnFN, checkInputFile(fofnFN)))

        xmlFN = path.join(self.rootDir, "data/subreads_dataset1.xml")
        ret = checkInputFile(xmlFN)
        self.assertTrue(ret.endswith('.xml'))
        fs = DataSet(ret).toExternalFiles()
        self.assertTrue(fs[0].endswith(
            "m140905_042212_sidney_c100564852550000001823085912221377_s1_X0.1.subreads.bam"
        ))
        self.assertTrue(fs[1].endswith(
            "m130406_011850_42141_c100513442550000001823074308221310_s1_p0.1.subreads.bam"
        ))