Permalink
Browse files

Completes path name on fopen calls

  • Loading branch information...
1 parent 9f5f37f commit 362c78a55662516cdf9dee5aba8aed14b38667f7 @mothur-westcott mothur-westcott committed Jul 29, 2016
@@ -769,7 +769,7 @@ unsigned long long MakeContigsCommand::processSingleFileOption(map<string, int>&
ofstream out;
variables["[filename]"] = thisOutputDir + m->getRootName(m->getSimpleName(it->first));
- cout << variables["[filename]"] << endl;
+ //cout << variables["[filename]"] << endl;
string thisGroupName = getOutputFileName("group",variables); outputNames.push_back(thisGroupName); outputTypes["group"].push_back(thisGroupName);
m->openOutputFile(thisGroupName, out);
@@ -2652,6 +2652,7 @@ int MakeContigsCommand::setLines(vector<string> fasta, vector<string> qual, vect
unsigned long long size;
//get num bytes in file
+ fasta[1] = m->getFullPathName(fasta[1]);
pFile = fopen (fasta[1].c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -2723,6 +2724,7 @@ int MakeContigsCommand::setLines(vector<string> fasta, vector<string> qual, vect
unsigned long long size;
//get num bytes in file
+ qual[0] = m->getFullPathName(qual[0]);
pFile = fopen (qual[0].c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -2781,6 +2783,7 @@ int MakeContigsCommand::setLines(vector<string> fasta, vector<string> qual, vect
FILE * pFile2;
//get num bytes in file
+ qual[1] = m->getFullPathName(qual[1]);
pFile2 = fopen (qual[1].c_str(),"rb");
if (pFile2==NULL) perror ("Error opening file");
else{
@@ -31,7 +31,7 @@ string MakeFileCommand::getHelpString(){
try {
string helpString = "";
helpString += "The make.file command takes a input directory and creates a file file containing the fastq or gz files in the directory.\n";
- helpString += "The make.fastq command parameters are inputdir, numcols and type. inputdir is required.\n";
+ helpString += "The make.file command parameters are inputdir, numcols and type. inputdir is required.\n";
helpString += "May create more than one file. Mothur will attempt to match paired files. \n";
helpString += "The type parameter allows you to set the type of files to look for. Options are fastq or gz. Default=fastq. \n";
helpString += "The numcols parameter allows you to set number of columns you mothur to make in the file. Default=3, meaning groupName forwardFastq reverseFastq. The groupName is made from the beginning part of the forwardFastq file. Everything up to the first '_' or if no '_' is found then the root of the forwardFastq filename.\n";
@@ -1374,6 +1374,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
unsigned long long size;
//get num bytes in file
+ qfilename = m->getFullPathName(qfilename);
pFile = fopen (qfilename.c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -1436,6 +1437,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
unsigned long long sizeR;
//get num bytes in file
+ rfilename = m->getFullPathName(rfilename);
rFile = fopen (rfilename.c_str(),"rb");
if (rFile==NULL) perror ("Error opening file");
else{
@@ -1455,6 +1457,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
unsigned long long size;
//get num bytes in file
+ filename = m->getFullPathName(filename);
pFile = fopen (filename.c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -1469,6 +1472,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
FILE * qFile;
//get num bytes in file
+ qfilename = m->getFullPathName(qfilename);
qFile = fopen (qfilename.c_str(),"rb");
if (qFile==NULL) perror ("Error opening file");
else{
@@ -1486,6 +1490,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
FILE * rFile;
//get num bytes in file
+ rfilename = m->getFullPathName(rfilename);
rFile = fopen (rfilename.c_str(),"rb");
if (rFile==NULL) perror ("Error opening file");
else{
@@ -341,6 +341,7 @@ int TrimFlowsCommand::execute(){
unsigned long long size;
//get num bytes in file
+ barcodePrimerComboFileNames[i][j] = m->getFullPathName(barcodePrimerComboFileNames[i][j]);
pFile = fopen (barcodePrimerComboFileNames[i][j].c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -777,6 +778,7 @@ vector<unsigned long long> TrimFlowsCommand::getFlowFileBreaks() {
unsigned long long size;
//get num bytes in file
+ flowFileName = m->getFullPathName(flowFileName);
pFile = fopen (flowFileName.c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
@@ -1646,6 +1646,7 @@ int TrimSeqsCommand::setLines(string filename, string qfilename) {
unsigned long long size;
//get num bytes in file
+ qfilename = m->getFullPathName(qfilename);
pFile = fopen (qfilename.c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
else{
View
@@ -1356,6 +1356,8 @@ vector<bool> MothurOut::isGZ(string filename){
int ableToOpen = openInputFileBinary(filename, fileHandle, gzin, ""); //no error
+ if (debug) { if (ableToOpen == 1) { mothurOut("[DEBUG]: unable to open gz file. \n"); } }
+
if (ableToOpen == 1) { return results; } // results[0] = false; results[1] = false;
else { results[0] = true; }

0 comments on commit 362c78a

Please sign in to comment.