示例#1
0
 def get_next_entry(self):
     toReturn = uToken()
     toReturn.obj = self.libNGS.getNextEntry_parser(self.obj)
     return toReturn
示例#2
0
        toReturn = uToken()
        toReturn.obj = self.libNGS.getNextEntry_parser(self.obj)
        return toReturn

    def get_previous_raw(self):
        self.libNGS.getPreviousRaw_parser.restype = c_char_p
        return self.libNGS.getPreviousRaw_parser(self.obj)

    def get_unformated_header(self):
        self.libNGS.getUnformatedHeader_parser.restype = c_char_p
        return self.libNGS.getUnformatedHeader_parser(self.obj)


if __name__ == "__main__":
    A = uParser("data/sample.bed", "BED")
    B = uToken()
    B = A.get_next_entry()
    print A.eof()
    while (A.eof() == 0):
        B = A.get_next_entry()
    print A.eof()

    if (B.is_param_set("CHR", 0)):
        print(B.get_param("CHR", 0))
    print A.get_previous_raw()
    print A.get_unformated_header()
    print "SAM"
    A = uParser("data/sample.sam", "SAM")
    B = uToken()
    B = A.get_next_entry()
    print A.eof()
示例#3
0
 def get_next_entry(self):
     toReturn =uToken()
     toReturn.obj= self.libNGS.getNextEntry_parser(self.obj)
     return toReturn
示例#4
0
        if (filename!=""):
            self.obj = self.libNGS.new_Writer(filename,typename)
        else:
            self.obj = self.libNGS.new_cout_Writer(typename)

    def __del__(self):
    	self.libNGS.delete_Writer(self.obj)

    def write_token(self,token):
        self.libNGS.writeToken_writer(self.obj,token.obj)


    def write_string(self, text):
        self.libNGS.printString_Writer(self.obj,text)


if __name__=="__main__":
    from uParser_wrapper import uParser

    samParser = uParser("data/sample.sam","SAM")
    bed6writer = uWriter("","BED6")
    someToken = uToken()
    print "Get first entry and write to standard output in bed6 to current.txt"
    someToken = samParser.get_next_entry()
    bed6writer.write_token(someToken)
    bed6writer = uWriter("current.txt","BED6")
    bed6writer.write_token(samParser.get_next_entry())

       
    
示例#5
0
        toReturn =uToken()
        toReturn.obj= self.libNGS.getNextEntry_parser(self.obj)
        return toReturn

    def get_previous_raw(self):
        self.libNGS.getPreviousRaw_parser.restype=c_char_p
        return self.libNGS.getPreviousRaw_parser(self.obj)

    def get_unformated_header(self):
        self.libNGS.getUnformatedHeader_parser.restype=c_char_p
        return self.libNGS.getUnformatedHeader_parser(self.obj)


if __name__=="__main__":
    A = uParser("data/sample.bed","BED")
    B = uToken()
    B = A.get_next_entry()
    print A.eof()
    while (A.eof()==0):
        B = A.get_next_entry()
    print A.eof()
    
    if (B.is_param_set("CHR",0)):
        print (B.get_param("CHR",0))
    print A.get_previous_raw()
    print A.get_unformated_header()
    print "SAM"
    A = uParser("data/sample.sam","SAM")
    B = uToken()
    B = A.get_next_entry()
    print A.eof()