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

alevin-fry infer unable to read mtx #150

Open
sojichld opened this issue Nov 19, 2024 · 8 comments
Open

alevin-fry infer unable to read mtx #150

sojichld opened this issue Nov 19, 2024 · 8 comments

Comments

@sojichld
Copy link

Hello, I am running alvein-fry and when I get to my infer step, I am getting this error:

2024-11-19 15:51:29 INFO read 2 read-level tags
2024-11-19 15:51:29 INFO read 1 alignemnt-level tags
2024-11-19 15:51:29 INFO File-level tag values TagMap { keys: [TagDesc { name: "cblen", typeid: Int(U16) }, TagDesc { name: "ulen", typeid: Int(U16) }], dat: [U16(16), U16(10)] }
  [00:00:17] [╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢]   34696/34696   finished quantifying 34,696 cells.                                                                                                    2024-11-19 15:51:47 INFO processed 9,749,359 total read records
2024-11-19 15:51:47 INFO Writing gene-level equivalence class with 183404 classes
check7
2024-11-19 15:51:49 INFO inferring abundances from equivalence class count input.
thread 'main' panicked at src/main.rs:2024-11-19 15:51:49598: 10:
could not perform inference from equivalence class counts.: error reading mtx format matrix : Tried to load real file into integer matrix.WARN
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 error reading mtx fileMismatchedMatrixMarketRead(Integer, Float)
./run_salmon_alevin_fry.sh: line 88: cd: ./results/f3cdf645-5f5a-49b5-a71a-1df120449ab4/salmon/alevin_fry_final: No such file or directory

Here is the full log.

Any idea why this is happening?

log.txt

@rob-p
Copy link
Contributor

rob-p commented Nov 20, 2024

Looks like a runner script is being used here that isnt part of alevin fry. Can you please share that?

@sojichld
Copy link
Author

Here is the script used. Thank you.

script.txt

@sojichld
Copy link
Author

sojichld commented Dec 5, 2024

Is there any more information I can provide you? I can continue to troubleshoot with a clearer idea of what is breaking.

@DongzeHE
Copy link
Contributor

Hi @sojichld,
This error says missing file. Could you please check if the files you provided to alevin-fry infer exist?

Moreover, alevin-fry quant will generate a count matrix for you, so it is unnecessary to run alevin-fry infer. According to your script, the count matrix should be in ${OUT_DIR_SAMPLE}/salmon/alevin_fry/alevin. You will see three files there, one is the count matrix, one is the column name file, and one is the row name file.

@sojichld
Copy link
Author

sojichld commented Dec 13, 2024

Yes, the following files are there.

image

When run in the same directory is produces the error:

alevin-fry infer --count-mat geqc_counts.mtx --eq-labels gene_eqclass.txt.gz --output-dir alevin_fry_final -t 16
2024-12-12 22:10:49 INFO inferring abundances from equivalence class count input.
thread 'main' panicked at /home/ademiluy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alevin-fry-0.9.0/src/main.rs:2024-12-12 22:10:49598: 10:
WARNcould not perform inference from equivalence class counts.: error reading mtx format matrix : Tried to load real file into integer matrix.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error reading mtx fileMismatchedMatrixMarketRead(Integer, Float)

@rob-p
Copy link
Contributor

rob-p commented Dec 13, 2024

It looks like the equivalence class matrix says it’s real valued (float), but it’s trying to load it as an integer matrix (it should be integral, as equivalence class counts should not be fractional). Can you share the head of the equivalence class count matrix file “geqc_counts.mtx”?

@sojichld
Copy link
Author

sojichld commented Dec 13, 2024

head -n 10 geqc_counts.mtx

%%MatrixMarket matrix coordinate real general
% written by sprs
34696 183404 1707373
1 1 1
1 2 1
1 3 2
1 4 1
1 5 1
1 6 2
1 7 2

@rob-p
Copy link
Contributor

rob-p commented Dec 13, 2024

Hi @sojichld,

Could you please try editing this file to change real to integer?

If that's the case then it's a type related regression upstream and we can fix it quickly in a patch.

Also, if this fixes it, could you please make sure the bug also occurs in the latest alevin-fry release (0.11.0, which is available on bioconda for easy installation).

Thanks!
Rob

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

No branches or pull requests

3 participants