Ejemplo n.º 1
0
    def testEasyAssembly(self):

        reads = ["Hello", "o_my_friend", "d_its_me"]
        nodes = [Node(str) for str in reads]
        graph = Graph(nodes)
        assembled = graph.assemble()

        self.assertEqual(assembled, "Hello_my_friend_its_me")
Ejemplo n.º 2
0
def main():
    parser = argparse.ArgumentParser(
        description = (" An implemention of a greedy sequence assembler using Graphs / Ham Paths"),
    )

    parser.add_argument("--reads")
    parser.add_argument("--fastq", help="Option to process reads as a fastq file")
    opts = parser.parse_args()
    
    log.info("Starting Greedy Assembly")
    log.info("Read file: %s", opts.reads)

    if opts.reads:
        nodes = read_file_to_node_set(opts.reads)
        graph = Graph(nodes)
        print(graph.assemble())

    elif opts.fastq:
        nodes = fastq_file_to_node_set(opts.fastq)
        graph = Graph.Graph(nodes)
        print(graph.assemble())
Ejemplo n.º 3
0
    def testSampleAssembly(self):

        read_file = "test/test.reads"

        nodes = []
        with open(read_file) as fh:
            for line in fh:
                nodes.append(Node(line.rstrip()))
        
        graph = Graph(nodes)
        assembled = graph.assemble()
        answer = "the_quick_brown_fox_jumps_over_the_lazy_dog"
        
        self.assertEqual(assembled, answer)