<commit_before>from margin.mappers.abstractMapper import AbstractMapper
from sonLib.bioio import system
import os

class Bwa(AbstractMapper):
    def run(self, args="-x pacbio"):
        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("bwa index %s" % localReferenceFastaFile)
        system("bwa mem %s %s %s > %s" % (args, localReferenceFastaFile, self.readFastqFile, self.outputSamFile))

class BwaChain(Bwa):
    def run(self):
        Bwa.run(self)
        self.chainSamFile()

class BwaRealign(Bwa):
    def run(self):
        Bwa.run(self)
        self.realignSamFile()
<commit_msg>Switching to work with bwa ont2d mode, not pacbio mode. This only affects the alignment when using the --bwa flag. <commit_after>from margin.mappers.abstractMapper import AbstractMapper
from sonLib.bioio import system
import os

class Bwa(AbstractMapper):
    def run(self, args="-x ont2d"):
        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("bwa index %s" % localReferenceFastaFile)
        system("bwa mem %s %s %s > %s" % (args, localReferenceFastaFile, self.readFastqFile, self.outputSamFile))

class BwaChain(Bwa):
    def run(self):
        Bwa.run(self)
        self.chainSamFile()

class BwaRealign(Bwa):
    def run(self):
        Bwa.run(self)
        self.realignSamFile()

{'fraction_non_alphanumeric': 0.10951526032315978, 'fraction_numerical': 0.0011968880909634949, 'mean_word_length': 3.8184438040345823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4301201', 'n_tokens_mistral': 527, 'n_tokens_neox': 528, 'n_words': 144}