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

Error in read *.lcd files #34

Open
filipevictoria opened this issue Nov 13, 2024 · 7 comments
Open

Error in read *.lcd files #34

filipevictoria opened this issue Nov 13, 2024 · 7 comments

Comments

@filipevictoria
Copy link

I'm trying to use ChromatrographR but every data then I tryed to call the same error occurs, as follow:

Warning in read_chroms(paths = "my path", :
Error in sub("^\037\004|^o\004", "", raw_xml) : input string 1 is invalid
The following chromatograms could not be interpreted: 1, 2, 3, 4, 5
list()
Warning messages:
1: In readLines(path_prop, skipNul = TRUE) :
incomplete final line found on '/var/folders/pl/j44pqpqx7xq6zg1wfr25y_ch0000gn/T/RtmptXE7MM/data_File_Property13828456058bb'
2: In sub("^\037\004|^o\004", "", raw_xml) :
unable to translate '�3.00Admin��1v,�Admin<89>Hg4������1.25-1�Unknownextrato_01Admin<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>...' to a wide string
3: In readLines(path_prop, skipNul = TRUE) :
incomplete final line found on '/var/folders/pl/j44pqpqx7xq6zg1wfr25y_ch0000gn/T/RtmptXE7MM/data_00_File_Property1382838618092'
4: In sub("^\037\004|^o\004", "", raw_xml) :
unable to translate '�3.00Admin{$..�AdminX�<9a>.������1.25-1�Unknownextrato_001Admin<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?...' to a wide string
5: In readLines(path_prop, skipNul = TRUE) :
incomplete final line found on '/var/folders/pl/j44pqpqx7xq6zg1wfr25y_ch0000gn/T/RtmptXE7MM/extrato_1_File_Property138289400e29'
6: In sub("^\037\004|^o\004", "", raw_xml) :
unable to translate '�3.00Admin!n,�Adminclzu,������1.25-1�Unknownextrato_11Admin<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>...' to a wide string
7: In readLines(path_prop, skipNul = TRUE) :
incomplete final line found on '/var/folders/pl/j44pqpqx7xq6zg1wfr25y_ch0000gn/T/RtmptXE7MM/extrato_2_File_Property138284c61aa7d'
8: In sub("^\037\004|^o\004", "", raw_xml) :
unable to translate '�3.00Admin>EI`,�AdminDk*f,������1.25-1�Unknownextrato_21Admin<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?A...' to a wide string
9: In readLines(path_prop, skipNul = TRUE) :
incomplete final line found on '/var/folders/pl/j44pqpqx7xq6zg1wfr25y_ch0000gn/T/RtmptXE7MM/extrato_3_File_Property1382820001bb8'
10: In sub("^\037\004|^o\004", "", raw_xml) :
unable to translate '�3.00Admin{�^R,�Admin<8e>�X,������1.25-1�Unknownextrato_31Admin<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>?<80>...' to a wide string

How can I fix this?

Thanks in advance

@ethanbass
Copy link
Owner

Hi,
Thanks for posting this issue. It looks to me like there are some special characters in the metadata that are causing the error. You could try setting read_metadata = FALSE in the call to read_chroms and see if this makes the error go away. If not, or if you want to access the metadata, I can try to track down the problem and come up with a patch if you are able to share one of your files with me.
Best,
Ethan

Repository owner deleted a comment Nov 13, 2024
@filipevictoria
Copy link
Author

Hi Ethan,
Thanks for you advice, I tried to set for read_metadata = FALSE and the same error occurs. Anyway, I used the shimazdu_ascii option and managed to open my data, but now I can't give the matplot command, but I get this "Error: unexpected '=' in:
"matplot(x = tpoints, y = data[[i]][,lambda],
+ type ="

, I send you both samples of my data in both *.lcd and *.txt format, I'm suspicious that it's really in my files, so if you find any inconsistencies and can help me I appreciate it.
Teste.zip

Thanks in advance

@ethanbass
Copy link
Owner

Hi,
I only see the ascii file in Teste.zip. Did you mean to include the .lcd file as well? I'd like to take a look at it.
To plot your chromatograms from the ascii files, try:

x <- read_chroms("/Users/ethanbass/Downloads/Teste/data_01.txt", format_in="shimadzu_ascii")
tpoints <- as.numeric(rownames(x[[1]][[1]]))
matplot(tpoints, x[[1]][[1]], type='l')

@filipevictoria
Copy link
Author

filipevictoria commented Nov 14, 2024 via email

@ethanbass
Copy link
Owner

Still didn't get the LCD. did you send it to ethanbass@gmail.com ?

@ethanbass
Copy link
Owner

Hi,
Thanks for sharing the example file. Your file doesn't contain either of the streams that I have been using to extract information about the retention times in other LCD files. Once I figure out where the times are stored, I should be able to make a patch for the LCD parser.

@ethanbass
Copy link
Owner

ethanbass commented Dec 14, 2024

This should be fixed by ethanbass/chromConverter@d7faa83. I had to infer the retention times based solely only on the interval between points (which is encoded in the chromatogram streams), assuming that the times start at 0.

The metadata for your files is also in a completely different format than other LCD files I've seen. I did my best to decode it, but there are still some fields missing.

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

2 participants