Skip to content

Commit

Permalink
Release/1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniWestbrook committed Apr 1, 2024
1 parent 5fbfea3 commit 17f2ca3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [1.6.0] - 2024-03-31
### Added
- Alignment command can now skip ORF detection and treat input sequences as transcripts (-q option)

## [1.5.0] - 2022-11-18
### Changed
- Updated PALADIN to use UniProt's new API system
Expand Down
13 changes: 10 additions & 3 deletions align.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int command_align(int argc, char *argv[]) {
memset(&opt0, 0, sizeof(mem_opt_t));
proxyAddress = NULL;

while ((c = getopt(argc, argv, "1epabgnMCSVYJjf:F:z:u:k:o:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:W:x:G:h:y:K:X:H:P:")) >= 0) {
while ((c = getopt(argc, argv, "1epqabgnMCSVYJjf:F:z:u:k:o:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:W:x:G:h:y:K:X:H:P:")) >= 0) {
if (c == 'k') opt->min_seed_len = atoi(optarg), opt0.min_seed_len = 1;
else if (c == 'u') opt->outputType = atoi(optarg);
else if (c == 'f') opt->min_orf_len = atoi(optarg);
Expand Down Expand Up @@ -147,6 +147,7 @@ int command_align(int argc, char *argv[]) {
else if (c == 'n') opt->proteinFlag |= ALIGN_FLAG_KEEP_PRO;
else if (c == 'J') opt->proteinFlag &= ~ALIGN_FLAG_ADJUST_ORF;
else if (c == 'p') opt->proteinFlag |= ALIGN_FLAG_MANUAL_PRO;
else if (c == 'q') opt->proteinFlag |= ALIGN_FLAG_MANUAL_TRANSCRIPT;
else if (c == 'c') opt->max_occ = atoi(optarg), opt0.max_occ = 1;
else if (c == 'd') opt->zdrop = atoi(optarg), opt0.zdrop = 1;
else if (c == 'v') bwa_verbose = atoi(optarg);
Expand Down Expand Up @@ -278,6 +279,12 @@ int command_align(int argc, char *argv[]) {
}
} else update_a(opt, &opt0);

// Check for incompatible options
if ((opt->proteinFlag & ALIGN_FLAG_MANUAL_PRO) && (opt->proteinFlag & ALIGN_FLAG_MANUAL_TRANSCRIPT)) {
logMessage(__func__, LOG_LEVEL_ERROR, "Both protein and transcriptome mode selected.\n");
return 1;
}

// Default to standard genetic code for translations
if (!opt->translations) opt->translations = convertTransArgs("");

Expand Down Expand Up @@ -440,14 +447,14 @@ int renderAlignUsage(const mem_opt_t * passOptions) {
fprintf(stderr, "Usage: paladin align [options] <idxbase> <in.fq>\n\n");

fprintf(stderr, "Gene detection options:\n\n");
fprintf(stderr, " -q disable ORF detection and treat input as transcript sequence\n");
fprintf(stderr, " -p disable ORF detection and treat input as protein sequence\n");
fprintf(stderr, " -b disable brute force ORF detection\n");
fprintf(stderr, " -b disable brute force detection\n");
fprintf(stderr, " -J do not adjust minimum ORF length (constant value) for shorter read lengths\n");
fprintf(stderr, " -f INT minimum ORF length accepted (as constant value) [%d]\n", passOptions->min_orf_len);
fprintf(stderr, " -F FLOAT minimum ORF length accepted (as percentage of read length) [%.2f]\n", passOptions->min_orf_percent);
fprintf(stderr, " -z INT[,...] Genetic code used for translation (-z ? for full list) [1]\n");


fprintf(stderr, "\nAlignment options:\n\n");
fprintf(stderr, " -t INT number of threads [%d]\n", passOptions->n_threads);
fprintf(stderr, " -k INT minimum seed length [%d]\n", passOptions->min_seed_len);
Expand Down
2 changes: 1 addition & 1 deletion main.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION STR(PACKAGE_VERSION_MAJOR) "." STR(PACKAGE_VERSION_MINOR) "." STR(PACKAGE_VERSION_REV)
#define PACKAGE_VERSION_MAJOR 1
#define PACKAGE_VERSION_MINOR 5
#define PACKAGE_VERSION_MINOR 6
#define PACKAGE_VERSION_REV 0
#endif

Expand Down
13 changes: 13 additions & 0 deletions protein.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ int getSequenceORF(char * passSequence, unsigned long passLength, int passTrans,
endSeqPos = getLastAlignedPos(passLength, relFrame);
endOrfPos = getLastAlignedOrfPos(passLength, relFrame, passOptions);

// Treat entire sequence as ORF in transcript mode
if (passOptions->proteinFlag & ALIGN_FLAG_MANUAL_TRANSCRIPT) {
addORFHistory(history, historySize, frameIdx);
history[0][frameIdx][historySize[frameIdx] - 1] = (strandDir == 1) ? relFrame : passLength - 1 - relFrame;
history[1][frameIdx][historySize[frameIdx] - 1] = getLastAlignedPos(passLength, frameIdx);

if (passOptions->proteinFlag & ALIGN_FLAG_BRUTE_ORF) {
continue;
}

break;
}

// Adjust min ORF length if requested
if ((passOptions->proteinFlag & ALIGN_FLAG_ADJUST_ORF) && (passLength < passOptions->min_orf_len)) {
endOrfPos = getLastAlignedPos(passLength, relFrame);
Expand Down
11 changes: 6 additions & 5 deletions protein.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
#define OUTPUT_TYPE_UNIPROT_SIMPLE 0
#define OUTPUT_TYPE_UNIPROT_FULL 1

#define ALIGN_FLAG_BRUTE_ORF 0x0001
#define ALIGN_FLAG_GEN_NT 0x0002
#define ALIGN_FLAG_KEEP_PRO 0x0004
#define ALIGN_FLAG_ADJUST_ORF 0x0008
#define ALIGN_FLAG_MANUAL_PRO 0x0010
#define ALIGN_FLAG_BRUTE_ORF 0x0001
#define ALIGN_FLAG_GEN_NT 0x0002
#define ALIGN_FLAG_KEEP_PRO 0x0004
#define ALIGN_FLAG_ADJUST_ORF 0x0008
#define ALIGN_FLAG_MANUAL_PRO 0x0010
#define ALIGN_FLAG_MANUAL_TRANSCRIPT 0x0020

typedef struct {
unsigned long startIdx;
Expand Down

0 comments on commit 17f2ca3

Please sign in to comment.