def main(useReadName, verbose): a = shasta.Assembler() print("Accessing data ...") a.accessMarkers() a.accessAlignmentCandidates() if verbose: a.accessAlignmentData() a.accessReadGraph() print("Writing to AlignmentCandidates.csv ...") a.writeAlignmentCandidates(useReadName, verbose) print("Done")
import argparse import shasta # Get the arguments. parser = argparse.ArgumentParser( description="Compute the phasing similarity between two oriented reads.") parser.add_argument("readId0", type=int, help="The read id of the first oriented read.") parser.add_argument("strand0", type=int, help="The strand (0 or 1) of the first oriented read.") parser.add_argument("readId1", type=int, help="The read id of the second oriented read.") parser.add_argument("strand1", type=int, help="The strand (0 or 1) of the second oriented read.") arguments = parser.parse_args() # Create the Assembler. a = shasta.Assembler() # Access what we need. a.accessPhasingData() # Do the work. print( a.computePhasingSimilarity(arguments.readId0, arguments.strand0, arguments.readId1, arguments.strand1))
#!/usr/bin/python3 import os import shasta # Find the path to the docs directory. thisScriptPath = os.path.realpath(__file__) thisScriptDirectory = os.path.dirname(thisScriptPath) thisScriptParentDirectory = os.path.dirname(thisScriptDirectory) docsDirectory = thisScriptParentDirectory + '/docs' # Initialize the assembler and access what we need. a = shasta.Assembler( smallDataFileNamePrefix='dataOnDisk/', largeDataFileNamePrefix='DataOnDisk/') a.accessReadsReadOnly() a.accessReadNamesReadOnly() a.accessKmers() a.accessMarkers() a.accessOverlaps() a.accessAlignmentData() a.accessMarkerGraphVertices() a.setupConsensusCaller('SimpleConsensusCaller') a.setDocsDirectory(docsDirectory) a.explore()
#!/usr/bin/python3 import os import shasta import GetConfig # Find the path to the docs directory. thisScriptPath = os.path.realpath(__file__) thisScriptDirectory = os.path.dirname(thisScriptPath) thisScriptParentDirectory = os.path.dirname(thisScriptDirectory) docsDirectory = thisScriptParentDirectory + '/docs' # Read the config file. config = GetConfig.getConfig() # Initialize the assembler. a = shasta.Assembler( largeDataFileNamePrefix='DataOnDisk/') a.accessAllSoft() a.setupConsensusCaller(config['Assembly']['consensusCaller']) a.setDocsDirectory(docsDirectory) a.explore()
import shasta import GetConfig import os import sys # Check that we have what we need. if not os.path.lexists('data'): raise Exception('Missing: data. Use SetupRunDirectory.py to set up the run directory.') if not os.path.lexists('Data'): raise Exception('Missing: Data. Use SetupRunDirectory.py to set up the run directory.') if not os.path.lexists('threadLogs'): raise Exception('Missing: threadLogs. Use SetupRunDirectory.py to set up the run directory.') if not os.path.lexists('shasta.conf'): raise Exception('Missing: configuration file shasta.conf. Sample available in shasta-install/conf.') # Read the config file. config = GetConfig.getConfig() # Create the assembler. useRunLengthReadsString = config['Reads']['useRunLengthReads'] if useRunLengthReadsString == 'True': useRunLengthReads = True elif useRunLengthReadsString == 'False': useRunLengthReads = False else: raise RuntimeError("Configuration parameter useRunLengthReads in section Reads must be True or False.") a = shasta.Assembler(useRunLengthReads = useRunLengthReads)
def initializeAssembler(config, fastaFileNames): # Create the Assembler. a = shasta.Assembler(createNew=True) return a
#!/usr/bin/python3 import shasta import GetConfig import os import sys # Check that we have what we need. if not os.path.lexists('Data'): raise Exception( 'Missing: Data. Use SetupRunDirectory.py to set up the run directory.') if not os.path.lexists('shasta.conf'): raise Exception( 'Missing: configuration file shasta.conf. Sample available in shasta-install/conf.' ) # Read the config file. config = GetConfig.getConfig() # Create the assembler. a = shasta.Assembler(createNew=True)