Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URIs matching error in sdrfToNfConf.R #46

Merged
merged 13 commits into from
May 20, 2024
Merged

Fix URIs matching error in sdrfToNfConf.R #46

merged 13 commits into from
May 20, 2024

Conversation

pmb59
Copy link
Member

@pmb59 pmb59 commented May 15, 2024

The PR fixes the error for the droplet protocol, that arises when uri_select is not a matrix or a data.frame:

During startup - Warning message:
Setting LC_CTYPE failed, using "C"
Error in FUN(X[[i]], ...) :
  Can't find URIs matching files: SRR13491863_2.fastq.gz
Calls: lapply -> FUN -> lapply -> FUN
Execution halted

The PR now reports a single value (TRUE or FALSE) as expected, as files in this case

          } else {
            missing_uri_files <- files[which(! any(apply(species.protocol.sdrf[, uri_cols], 2, function(x) basename(x) == files))  )]

has a single file.

Tested with the following accessions: E-GEOD-153723, E-GEOD-157775, E-MTAB-4850


if (is.data.frame(uri_select) || is.matrix(uri_select)) {
# the following line gives an error: dim(X) must have a positive length
# if not a matrix or a data.frame
missing_uri_files <- files[which(! apply(apply(species.protocol.sdrf[,uri_cols], 2, function(x) basename(x) == files), 1, any))]
} else {
missing_uri_files <- files[which(! apply(as.data.frame( apply(species.protocol.sdrf[,uri_cols], 2, function(x) basename(x) == files) ), 1, any))]
missing_uri_files <- files[which(! any(apply(species.protocol.sdrf[, uri_cols], 2, function(x) basename(x) == files)) )]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain briefly what are you trying to do here.. So I know what I understood from code is right..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anilthanki Did you have a look to the description of the PR?

Basically, in this chunk for each library it is checked if there is a fastq URI that can supply the file. The error was in the fix for the case when uri_select is not a matrix or a data.frame

Copy link
Contributor

@anilthanki anilthanki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pmb59
Copy link
Member Author

pmb59 commented May 20, 2024

Thanks for reviewing @anilthanki

@pmb59 pmb59 merged commit ac7bf36 into develop May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants