Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #359 from ComparativeGenomicsToolkit/minigraph
Graphmap masking pipeline
- Loading branch information
Showing
19 changed files
with
347 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2009-2011 by Benedict Paten (benedictpaten@gmail.com) | ||
* | ||
* Released under the MIT license, see LICENSE.txt | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <limits.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <stdlib.h> | ||
#include <time.h> | ||
#include <getopt.h> | ||
#include <inttypes.h> | ||
#include <sys/types.h> | ||
#include <sys/param.h> | ||
#include <sys/stat.h> | ||
#include <dirent.h> | ||
#include <math.h> | ||
#include <ctype.h> | ||
|
||
#include "bioioC.h" | ||
#include "cactus.h" | ||
|
||
void usage() { | ||
fprintf(stderr, "cactus_softmask2hardmask [fastaFile]\n"); | ||
} | ||
|
||
static void hardmask(void* out_file, const char* name, const char* seq, int64_t length) { | ||
char* uc_seq = (char*)seq; | ||
for (int64_t i = 0; i < length; ++i) { | ||
if (islower(uc_seq[i])) { | ||
uc_seq[i] = 'N'; | ||
} | ||
} | ||
fastaWrite(uc_seq, (char*)name, (FILE*)out_file); | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
if(argc == 1) { | ||
usage(); | ||
return 0; | ||
} | ||
|
||
for (int64_t j = 1; j < argc; j++) { | ||
FILE *fileHandle; | ||
if (strcmp(argv[j], "-") == 0) { | ||
fileHandle = stdin; | ||
} else { | ||
fileHandle = fopen(argv[j], "r"); | ||
if (fileHandle == NULL) { | ||
st_errnoAbort("Could not open input file %s", argv[j]); | ||
} | ||
} | ||
fastaReadToFunction(fileHandle, stdout, hardmask); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.