Permalink
Browse files

Fixes Windows error with make.file

  • Loading branch information...
1 parent 4799886 commit 23f155b68faeeaf6ec4ba89a3d59f82797cc7cec @mothur-westcott mothur-westcott committed Feb 17, 2017
Showing with 30 additions and 3 deletions.
  1. +28 −2 source/commands/makefilecommand.cpp
  2. +2 −1 source/commands/sracommand.cpp
@@ -336,19 +336,45 @@ int MakeFileCommand::fillAccnosFile(string tempFile){
try {
string findCommand = "";
+ string tempOut = tempFile;
tempFile = "\"" + tempFile + "\"";
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
findCommand = "find \"" + inputDir.substr(0, inputDir.length()-1) + "\" -maxdepth 1 -name \"*." + typeFile + "\" > " + tempFile;
if (m->debug) { m->mothurOut(findCommand + "\n"); }
system(findCommand.c_str());
+
#else
//use ls command
-
- findCommand = "ls *." + typeFile + " > " + tempFile;
+ findCommand = "find \"\" " + inputDir.substr(0, inputDir.length()-1) + "\\*." + typeFile + " > " + tempFile;
if (m->debug) { m->mothurOut(findCommand + "\n"); }
system(findCommand.c_str());
+
+ ifstream in;
+ ofstream out;
+ tempOut += ".temp";
+
+ tempFile = tempFile.substr(1, tempFile.length()-2); //remove ""
+
+ m->openOutputFile(tempOut, out);
+
+ m->openInputFile(tempFile, in);
+
+ string junk, filename;
+ while (!in.eof()) {
+ if (m->control_pressed) { break; }
+ in >> junk; m->gobble(in);
+ in >> filename; m->gobble(in);
+
+ out << filename << endl;
+ }
+ in.close();
+ out.close();
+
+ m->mothurRemove(tempFile);
+ m->renameFile(tempOut, tempFile);
+
#endif
return 0;
@@ -54,7 +54,7 @@ string SRACommand::getHelpString(){
try {
string helpString = "";
helpString += "The make.sra command creates the necessary files for a NCBI submission. The xml file and individual sff or fastq files parsed from the original sff or fastq file.\n";
- helpString += "The make.sra command parameters are: sff, fastq, file, oligos, project, mimarksfile, pdiffs, bdiffs, ldiffs, sdiffs, tdiffs, checkorient, platform, orientation, libstrategy, datatype, libsource, libselection, instrument and includescrap.\n";
+ helpString += "The make.sra command parameters are: sff, fastq, file, oligos, project, mimarksfile, pdiffs, bdiffs, ldiffs, sdiffs, tdiffs, checkorient, platform, orientation, libstrategy, datatype, libsource, libselection, instrument, includescrap and trim.\n";
helpString += "The sff parameter is used to provide the original sff file.\n";
helpString += "The fastq parameter is used to provide the original fastq file.\n";
helpString += "The project parameter is used to provide your project file.\n";
@@ -76,6 +76,7 @@ string SRACommand::getHelpString(){
helpString += "The libsource parameter is used to specify library source. Default=METAGENOMIC. Choices are METAGENOMIC,GENOMIC,TRANSCRIPTOMIC,METATRANSCRIPTOMIC,SYNTHETIC,VIRAL_RNA,OTHER. This is a controlled vocabulary section in the XML file that will be generated. \n";
helpString += "The libselection parameter is used to specify library selection. Default=PCR. Choices are PCR,RANDOM,RANDOM_PCR,RT-PCR,HMPR,MF,CF-S,CF-H,CF-T,CF-M,MDA,MSLL,cDNA,ChIP,MNase,DNAse,Hybrid_Selection,Reduced_Representation,Restriction_Digest,5-methylcytidine_antibody,MBD2_protein_methyl-CpG_binding_domain,CAGE,RACE,size_fractionation,Padlock_probes_capture_method,other,unspecified. This is a controlled vocabulary section in the XML file that will be generated. \n";
helpString += "The datatype parameter is used to specify datatype. Default=METAGENOME. Choices are METAGENOME,GENOME_SEQUENCING,METAGENOMIC_ASSEMBLY,ASSEMBLY,TRANSCRIPTOME,PROTEOMIC,MAP,CLONE_ENDS,TARGETED_LOCI,RANDOM_SURVEY,EXOME,VARIATION,EPIGENOMICS,PHENOTYPE,GENOTYPE,OTHER. This is a controlled vocabulary section in the XML file that will be generated. \n";
+ helpString += "The trim parameter allows you to indicate if you would like a sequences and quality scores trimmed to the clipQualLeft and clipQualRight values. Default=True. \n";
helpString += "make.sra(sff=sff=GHL4YHV01.sff, GHL4YHV01.oligos, project=test.project, mimark=MIMarksData.txt)\n";
return helpString;
}

0 comments on commit 23f155b

Please sign in to comment.