/***************************************************************************** # Copyright (C) 1994-2008 by David Gordon. # All rights reserved. # # This software is part of a beta-test version of the Consed/Autofinish # package. It should not be redistributed or # used for any commercial purpose, including commercially funded # sequencing, without written permission from the author and the # University of Washington. # # This software is provided ``AS IS'' and any express or implied # warranties, including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose, are disclaimed. # In no event shall the authors or the University of Washington be # liable for any direct, indirect, incidental, special, exemplary, or # consequential damages (including, but not limited to, procurement of # substitute goods or services; loss of use, data, or profits; or # business interruption) however caused and on any theory of liability, # whether in contract, strict liability, or tort (including negligence # or otherwise) arising in any way out of the use of this software, even # if advised of the possibility of such damage. # # Building Consed from source is error prone and not simple which is # why I provide executables. Due to time limitations I cannot # provide any assistance in building Consed. Even if you do not # modify the source, you may introduce errors due to using a # different version of the compiler, a different version of motif, # different versions of other libraries than I used, etc. For this # reason, if you discover Consed bugs, I can only offer help with # those bugs if you first reproduce those bugs with an executable # provided by me--not an executable you have built. # # Modifying Consed is also difficult. Although Consed is modular, # some modules are used by many other modules. Thus making a change # in one place can have unforeseen effects on many other features. # It may takes months for you to notice these other side-effects # which may not seen connected at all. It is not feasable for me to # provide help with modifying Consed sources because of the # potentially huge amount of time involved. # #*****************************************************************************/ // main.cpp_part7 else if ( soLowerCaseArg == "-ace" ) { bAceFileOnCommandLine = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -ace must be followed by a space and then the ace filename" << endl; exit( -1 ); } filAceFileToOpen = argv[n]; } else if ( soLowerCaseArg == "-socket" ) { bCreateSocketToControlConsed = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -socket must be followed by a space and then a number (the local port number)" << endl; exit( -1 ); } soSocketToControlConsedLocalPortNumber = argv[n]; } else if ( soLowerCaseArg == "-nophd" ) { bNoPhdFiles = true; } else if ( soLowerCaseArg == "-autofinish" ) { bAutomatedFinishProgram = true; } else if ( soLowerCaseArg == "-doexperiments" ) { bDoExperiments = true; } else if ( soLowerCaseArg == "-autopcramplify" ) { bAutoPCRAmplify = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -autoPCRAmplify must be followed by a space and then the name of the file of primer regions" << endl; exit( -1 ); } filFileOfPrimerRegions = argv[n]; } else if ( soLowerCaseArg == "-justcheckautofinishreads" ) { bJustCheckAutoFinishReads = true; } else if ( soLowerCaseArg == "-id" ) { bID = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -id must be followed by a space and then the id" << endl; exit( -1 ); } soID = argv[n]; } else if ( soLowerCaseArg == "-contig" ) { bContigSpecified = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -contig must be followed by a space and then the contig name" << endl; exit( -1 ); } soContig = argv[n]; } else if ( soLowerCaseArg == "-filenamesfile" ) { bFileNamesFile = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -filenamesFile must be followed by a space and then the name of the file to contain the filenames" << endl; exit( -1 ); } soFilenamesFile = argv[n]; } else if ( soLowerCaseArg == "-fileofphdfiles" ) { bFileOfPhdFiles = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -fileOfPhdFiles must be followed by a space and then the name of the file of phd files" << endl; exit( -1 ); } filFileOfPhdFiles = argv[n]; } else if ( soLowerCaseArg == "-terminate" ) { bTerminateAfterStartup = true; } else if ( soLowerCaseArg == "-read_only" ) { bReadOnly = true; } else if ( soLowerCaseArg == "-addnewreads" ) { bAddNewReads = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -addNewReads must be followed by a space and then the name of the file containing the reads to be added" << endl; exit( -1 ); } filFileOfReadsOrPhdsToAdd = argv[n]; } else if ( soLowerCaseArg == "-addreads" ) { bAddReads = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -addReads must be followed by a space and then the name of the file containing a list of the cross_match alignment files" << endl; exit( -1 ); } filAddNewReadsAlignmentsFOF = argv[n]; } else if ( soLowerCaseArg == "-chem" ) { bChem = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -chem must be followed by a space and then the chemistry which can be one of solexa, 454, or Sanger" << endl; exit( -1 ); } soChemistry = argv[n]; } else if ( soLowerCaseArg == "-autoedit" ) { bAutoEdit = true; } else if ( ( soLowerCaseArg == "-newacefilename" ) || ( soLowerCaseArg == "-newacefile" ) ) { bNewAceFileName = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -newAceFilename must be followed by a space and then the name of the ace file to be created" << endl; exit( -1 ); } filNewAceFile = argv[n]; } else if ( soLowerCaseArg == "-addalignedsequence" ) { bAddAlignedSequence = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -addAlignedSequence must be followed by a space and then the name of the fasta file created by alignment2Ace.perl" << endl; exit( -1 ); } filAlignmentFastaFile = argv[n]; } else if ( soLowerCaseArg == "-tagsnps" ) { bTagSNPs = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -tagSNPs must be followed by a space and then the name of the fof of SNP reads" << endl; exit( -1 ); } filFileOfReadsOrPhdsToAddForTagSNPs = argv[n]; } else if ( soLowerCaseArg == "-phdwithwritem" ) { bPhdWithWRItem = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phdWithWRItem must be followed by a space and then the name of the phd file containing the WR Item specifying the genomic region of the assembly" << endl; exit( -1 ); } filPhdFileWithWRItem = argv[n]; } else if ( soLowerCaseArg == "-autoreport" ) { bAutoReport = true; } else if ( soLowerCaseArg == "-nav" ) { bCustomNavigation = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -nav must be followed by a space and then the name of the custom navigation file" << endl; exit( -1 ); } filCustomNavigation = argv[n]; } else if ( soLowerCaseArg == "-allowtimestampmismatch" ) { bAllowTimestampMismatch = true; } else if ( soLowerCaseArg == "-singlesignal" ) { bPrintSingleSignal = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -singleSignal must be followed by a space and then the unpadded consensus position" << endl; exit( -1 ); } soUnpaddedConsPosForSingleSignal = argv[n]; } else if ( soLowerCaseArg == "-maincontigpos" ) { bMainContigPos = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -maincontigpos must be followed by a space and then the unpadded consensus position of the main contig" << endl; exit( -1 ); } soUnpaddedConsPos = argv[n]; } else if ( soLowerCaseArg == "-solexa2phdball" ) { bSolexa2PhdBall = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -solexa2PhdBall must be followed by a space and then the name of a file containing the name of the solexa fastq files." << endl; exit( -1 ); } filSolexaFOF = argv[n]; } else if ( soLowerCaseArg == "-phdballfof" ) { bNewPhdBallFOF = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phdBallFOF must be followed by a space and then the name of the phdballfof to be created. This file contains a list of all of the phdballs created." << endl; exit( -1 ); } filNewPhdBallFOF = argv[n]; } else if ( soLowerCaseArg == "-selectregions" ) { bSelectRegions = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -selectRegions must be followed by a space and then the name of the regions file" << endl; exit( -1 ); } filRegionsFile = argv[n]; } else if ( soLowerCaseArg == "-alignments" ) { bAlignments = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -alignments must be followed by a space and then the name of an fof of alignments files for -selectRegions" << endl; exit( -1 ); } filSelectRegionsAlignmentsFOF = argv[n]; } else if ( soLowerCaseArg == "-phdball2fasta" ) { bPhdBall2Fasta = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phdBall2Fasta must be followed by a space and then the name of the phd ball" << endl; exit( -1 ); } filPhdBall = argv[n]; } else if ( soLowerCaseArg == "-fasta" ) { bFasta = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -fasta must be followed by a space and then the name of the output fasta file" << endl; exit( -1 ); } filFasta = argv[n]; } else if ( soLowerCaseArg == "-fastq" ) { bFastq = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -fastq must be followed by a space and then the name of the output fastq file" << endl; exit( -1 ); } filFastq = argv[n]; } else if ( soLowerCaseArg == "-testreadphdball" ) { bTestReadPhdBall = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -testReadPhdBall must be followed by a space and then the phdball to be read for testing purposes" << endl; exit( -1 ); } filPhdBallForTestRead = argv[n]; } else if ( soLowerCaseArg == "-removereads" ) { bRemoveReads = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -removeReads must be followed by a space and then the file containing the reads to be removed. Use consed.removeReadsPutIntoOwnContig: true/false to determine whether the removed reads are just put into their own contigs or completely removed" << endl; exit( -1 ); } filReadsToBeRemoved = argv[n]; } else if ( soLowerCaseArg == "-removecontigs" ) { bRemoveContigs = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -removeContigs must be followed by a space and then the file containing the contigs to be removed. Use consed.removeReadsPutIntoOwnContig: true/false to determine whether the removed reads are just put into their own contigs or completely removed" << endl; exit( -1 ); } filContigsToBeRemoved = argv[n]; } else if ( soLowerCaseArg == "-printdefaultresources" ) { bPrintDefaultResources = true; } else if ( soLowerCaseArg == "-sff2phdball" ) { bSff2PhdBall = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -sff2PhdBall must be followed by a space and then full path of the sff file" << endl; exit( -1 ); } filSffFile = argv[n]; } else if ( soLowerCaseArg == "-phdball" ) { bPhdBall = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phdBall must be followed by a space and then the full path of the phd ball" << endl; exit( -1 ); } filNewPhdBall = argv[n]; } else if ( soLowerCaseArg == "-fof" ) { bFOF = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -fof must be followed by a space and then the name of a file containing read names" << endl; exit( -1 ); } filFOF = argv[n]; } else if ( soLowerCaseArg == "-editconsedrc" ) { bEditConsedrc = true; } else if ( soLowerCaseArg == "-changeconsensus" ) { bChangeConsensus = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -changeConsensus must be followed by a space and then the name of the file with lines like this: Contig21 28-30 x where Contig21 is the contig, 28-30 are the unpadded positions and x is the new base. To change a pad (let's say at padded position 35, specify this as *35 as in Contig21 *35-*40 c" << endl; exit( -1 ); } filChangeConsensus = argv[n]; } else if ( soLowerCaseArg == "-snpgenome" ) { bSnpGenome = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -snpGenome must be followed by a space and then the full path of the snp table in ucsc format" << endl; exit( -1 ); } filSnps = argv[n]; } else if ( soLowerCaseArg == "-genome" ) { bGenome = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -genome is used by -snpGenome. It must be followed by a space and then a file that has 3 columns for each chromosome: the name of the chromosome in the snp file, the full path of the corresponding chromosome in fasta format, and the full path of the snp-annotated chromosome to be created." << endl; exit( -1 ); } filGenome = argv[n]; } else if ( soLowerCaseArg == "-valid" ) { bValid = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -valid is used by -snpGenome. It must be followed by a space and then a file that lists, one per line, each validation combination for which *no* snps are to be used." << endl; exit( -1 ); } filValidation = argv[n]; } else if ( soLowerCaseArg == "-diffchromosomes" ) { bDiffChromosomes = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -diffChromosomes must be followed by a space and then the full or relative path of the other directory containing the chromosome files" << endl; exit( -1 ); } filOtherDirectory = argv[n]; } else if ( soLowerCaseArg == "-addflowcells" ) { bAddFlowcells = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -addFlowcells must be followed by a space and then the full or relative path of file containing flowcell lines" << endl; exit( -1 ); } filFlowcellsToAdd = argv[n]; } else if ( soLowerCaseArg == "-controlfile" ) { bControlFile = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -controlFile must be followed by a space and then the full or relative path of the control file" << endl; exit( -1 ); } filControlFile = argv[n]; } else if ( soLowerCaseArg == "-fixcontigends" ) { bFixContigEnds = true; } else if ( soLowerCaseArg == "-contigendsfof" ) { bContigEndsFOF = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -contigEndsFOF must be followed by a space and then the full or relative path of a file which each line having (contig name) (left or right)" << endl; exit( -1 ); } filContigEndsFOF = argv[n]; } else if ( soLowerCaseArg == "-geneclassifications" ) { bGeneClassifications = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -geneClassifications must be followed by a space and then the full or relative path of the list of genomic locations in the format chr1 345671" << endl; exit( -1 ); } filGenomicLocations = argv[n]; } else if ( soLowerCaseArg == "-chromosomesfof" ) { bChromosomesFOF = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -chromosomesFOF must be followed by a space and then the full or relative path of a file containing the full or relative paths of the chromosomes in fasta format" << endl; exit( -1 ); } filChromosomesFOF = argv[n]; } else if ( soLowerCaseArg == "-knowngene" ) { bKnownGene = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -knownGene must be followed by a space and then the full or relative path of a file containing the full or relative paths of the knownGene.txt file" << endl; exit( -1 ); } filKnownGene = argv[n]; } else if ( soLowerCaseArg == "-phaster2phdball" ) { bPhaster2PhdBall = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phaster2PhdBall must be followed by a space and then the full or relative path of a file containing a list of phaster output files (assumes cref2 and -report_type:2 )" << endl; exit( -1 ); } filPhasterFOF = argv[n]; } else if ( soLowerCaseArg == "-phasterlocations" ) { bPhasterLocations = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phasterLocations must be followed by a space and then the full or relative path of a file containing a list of locations in the form (full phaster genomic location) (chromosome) (1-based chromosome position)" << endl; exit( -1 ); } filPhasterLocations = argv[n]; } else if ( soLowerCaseArg == "-phylofof" ) { bPhyloFOF = true; ++n; if ( n >= nArgc ) { cerr << "Fatal Error: -phyloFOF must be followed by a space and then the full or relative path of a file containing the full or relative path of phyloP conservation score files in wig format such as chr11.phyloP44way.wigFix.gz" << endl; exit( -1 ); } filPhyloFOF = argv[n]; } else if ( soLowerCaseArg == "-miscprogram" ) { bMiscProgram = true; }