from margin.mappers.abstractMapper import AbstractMapper
from sonLib.bioio import system
import os

class Minimap2(AbstractMapper):
    def run(self, args="-ax map-ont -N 0"):
        localReferenceFastaFile = os.path.join(self.getLocalTempDir(), "ref.fa") #Because BWA builds these crufty index files, copy to a temporary directory
        system("cp %s %s" % (self.referenceFastaFile, localReferenceFastaFile))
        system("minimap2 %s %s %s > %s" % (args, localReferenceFastaFile, self.readFastqFile, self.outputSamFile))

class Minimap2Chain(Minimap2):
    def run(self):
        Minimap2.run(self)
        self.chainSamFile()

class Minimap2Realign(Minimap2):
    def run(self):
        Minimap2.run(self)
        self.realignSamFile()


08871efa16bf3d44a35aec5022b2c69b9042338b
<mask token>


class Minimap2Chain(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.chainSamFile()


class Minimap2Realign(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.realignSamFile()

<mask token>


class Minimap2(AbstractMapper):
    <mask token>


class Minimap2Chain(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.chainSamFile()


class Minimap2Realign(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.realignSamFile()

<mask token>


class Minimap2(AbstractMapper):

    def run(self, args='-ax map-ont -N 0'):
        localReferenceFastaFile = os.path.join(self.getLocalTempDir(), 'ref.fa'
            )
        system('cp %s %s' % (self.referenceFastaFile, localReferenceFastaFile))
        system('minimap2 %s %s %s > %s' % (args, localReferenceFastaFile,
            self.readFastqFile, self.outputSamFile))


class Minimap2Chain(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.chainSamFile()


class Minimap2Realign(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.realignSamFile()

from margin.mappers.abstractMapper import AbstractMapper
from sonLib.bioio import system
import os


class Minimap2(AbstractMapper):

    def run(self, args='-ax map-ont -N 0'):
        localReferenceFastaFile = os.path.join(self.getLocalTempDir(), 'ref.fa'
            )
        system('cp %s %s' % (self.referenceFastaFile, localReferenceFastaFile))
        system('minimap2 %s %s %s > %s' % (args, localReferenceFastaFile,
            self.readFastqFile, self.outputSamFile))


class Minimap2Chain(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.chainSamFile()


class Minimap2Realign(Minimap2):

    def run(self):
        Minimap2.run(self)
        self.realignSamFile()

from margin.mappers.abstractMapper import AbstractMapper
from sonLib.bioio import system
import os

class Minimap2(AbstractMapper):
    def run(self, args="-ax map-ont -N 0"):
        localReferenceFastaFile = os.path.join(self.getLocalTempDir(), "ref.fa") #Because BWA builds these crufty index files, copy to a temporary directory
        system("cp %s %s" % (self.referenceFastaFile, localReferenceFastaFile))
        system("minimap2 %s %s %s > %s" % (args, localReferenceFastaFile, self.readFastqFile, self.outputSamFile))

class Minimap2Chain(Minimap2):
    def run(self):
        Minimap2.run(self)
        self.chainSamFile()

class Minimap2Realign(Minimap2):
    def run(self):
        Minimap2.run(self)
        self.realignSamFile()

