Skip to content

Commit

Permalink
BUGFIX : sequence subset selection not supported when accessibilities
Browse files Browse the repository at this point in the history
are read from file
  • Loading branch information
martin-raden committed Dec 1, 2023
1 parent e4c7fe7 commit dffab13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

# IntaRNA
- new arguments t|qPfScale to tune ViennaRNA pf_scale parameter used
to scale partition functions for ED value computation to avoid overflows
to scale partition functions for ED value computation to avoid overflows
- BUGFIX : sequence subset selection not supported when accessibilities are read
from file

################################################################################
################################################################################
Expand Down
4 changes: 2 additions & 2 deletions src/bin/CommandLineParsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,8 @@ parse(int argc, char** argv)
}

// validate accessibility input from file (requires parsed sequences)
validate_qAccFile( qAccFile );
validate_tAccFile( tAccFile );
validate_qAccFile( qAccFile, qSet );
validate_tAccFile( tAccFile, tSet );

//////////////// INTERACTION CONSTRAINTS ///////////////////

Expand Down
22 changes: 18 additions & 4 deletions src/bin/CommandLineParsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,9 @@ class CommandLineParsing {
/**
* Validates the qAccFile argument.
* @param value the argument value to validate
* @param subSet subset of query sequences used for prediction
*/
void validate_qAccFile(const std::string & value);
void validate_qAccFile(const std::string & value, const IndexRange & subSet);

/**
* Validates the SHAPE reactivity data file.
Expand Down Expand Up @@ -847,8 +848,9 @@ class CommandLineParsing {
/**
* Validates the tAccFile argument.
* @param value the argument value to validate
* @param subSet subset of target sequences used for prediction
*/
void validate_tAccFile(const std::string & value);
void validate_tAccFile(const std::string & value, const IndexRange & subSet);

/**
* Validates the explicit seed argument.
Expand Down Expand Up @@ -1196,7 +1198,7 @@ void CommandLineParsing::validate_qSet(const std::string & value) {
////////////////////////////////////////////////////////////////////////////

inline
void CommandLineParsing::validate_qAccFile(const std::string & value)
void CommandLineParsing::validate_qAccFile(const std::string & value, const IndexRangeList & subSet )
{
// if not empty
if (!value.empty()) {
Expand All @@ -1210,6 +1212,12 @@ void CommandLineParsing::validate_qAccFile(const std::string & value)
}
} else {
// should be file
// subsetting not supported, since indexing is screwed
if (!subSet.empty()) {
LOG(ERROR) <<"reading query accessibilities for a subset of sequences from '"<<value<<"' is not supported";
updateParsingCode(ReturnCode::STOP_PARSING_ERROR);
}
// check needed files
for (auto rna = getQuerySequences().begin(); rna != getQuerySequences().end(); rna++) {
if ( ! validateFile( getFullFilename(value, NULL, &(*rna) ) ) ) {
LOG(ERROR) <<"query accessibility file '"<<value<<"' could not be found";
Expand Down Expand Up @@ -1277,7 +1285,7 @@ void CommandLineParsing::validate_tSet(const std::string & value) {
////////////////////////////////////////////////////////////////////////////

inline
void CommandLineParsing::validate_tAccFile(const std::string & value)
void CommandLineParsing::validate_tAccFile(const std::string & value, const IndexRange & subSet)
{
// if not empty
if (!value.empty()) {
Expand All @@ -1291,6 +1299,12 @@ void CommandLineParsing::validate_tAccFile(const std::string & value)
}
} else {
// should be file
// subsetting not supported, since indexing is screwed
if (!subSet.empty()) {
LOG(ERROR) <<"reading target accessibilities for a subset of sequences from '"<<value<<"' is not supported";
updateParsingCode(ReturnCode::STOP_PARSING_ERROR);
}
// check needed files
for (auto rna = getTargetSequences().begin(); rna != getTargetSequences().end(); rna++) {
if ( ! validateFile( getFullFilename(value, &(*rna), NULL ) ) ) {
LOG(ERROR) <<"target accessibility file '"<<value<<"' could not be found";
Expand Down

0 comments on commit dffab13

Please sign in to comment.