# Trouble using seqtk\_trimfq

**URL:** <https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691>\
**Category:** usegalaxy.eu support\
**Tags:** workflow, troubleshooting, fastq\_manipulation\
**Created:** [February 10, 2025, 3:00pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691 "2025-02-10T15:00:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dede\_sa](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/dede_sa/32/6740_2.png) [@dede\_sa](https://help.galaxyproject.org/u/dede_sa)\
**Post date:** [February 10, 2025, 3:00pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/1 "2025-02-10T15:00:15Z")

</div>

My workflow is supposed to quality trim sanger sequences (collection), based on [Hands-on: Clean and manage Sanger sequences from raw files to aligned consensus / Clean and manage Sanger sequences from raw files to aligned consensus / Sequence analysis](https://training.galaxyproject.org/training-material/topics/sequence-analysis/tutorials/Manage_AB1_Sanger/tutorial.html#prepare-sequence-data) . However, any way I try to convert FASTQ to FASTA from the seqtk\_trimfq output it fails. However, if I try to re-run the individual sanger sequences, it succeeds. Therefore I don’t know why this tool is not working in the workflow.

> **[Galaxy](https://usegalaxy.eu/published/workflow?id=52cb9bacc26b013e)**
>
> Galaxy is a community-driven web-based analysis platform for life science research.

Is there any reason for the failure? The seqtk\_trimfq actually works but the workflow fails at the FASTQ to FASTA step. I tried with or without the FASTQ Groomer and both fails, so I think it has something to do with the seqtk\_trimfq output.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [February 10, 2025, 9:44pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/2 "2025-02-10T21:44:40Z")

</div>

Welcome, @dede_sa

What is the error message from the tool? Find this on the Job Details view ([using the i-con](https://training.galaxyproject.org/training-material/faqs/galaxy/datasets_icons.html)). You can screenshot any messages on the dataset itself and all three logs (these sections expand) would be helpful. Just one is probably enough.

I’m also not sure why the workflow includes the **Fastq Groomer** step at all. It is not modifying the quality score scaling in a file when the input option is set as the data already being in fastqsanger format (Illumina 1.8+ Sanger Phred). As it is in that workflow, that step is just fully duplicating your data, exactly. There are other uses but the tool is not being used that way in your current workflow.

So, my next question is what does the **ab1 to FASTQ converter** output look like? I would be interested in the assigned datatype and a peek view of the @/+headers and a few lines of the sequence and quality score lines.

Why it works when run individually versus a collection is odd but maybe with those two data points we’ll get closers to solving that. My first guess would be a tool version difference between the workflow and the tool panel. My second guess would be some problem with the element identifiers on the collection, or the structure of that collection. You could run a tool like **Extract element identifiers** then post back a few lines, and also explain or screenshot what this collection’s structure looks like.

And finally, you could try disconnecting all noodles between tools in your workflow, then reconnect them in the order of tool execution. Collections have a few structures, and that “metadata” is passed through. Paired collections (lists of lists) are different than simple collections (lists). The wofkflow editor will alert you if the collection structures are a mismatch, then you can add steps to reorganize the structure, then build it up again, all as needed (these do not duplicate data since a collection folder is just a _reference_ to data) with tools in **Collection Operations**. [Hands-on: Using dataset collections / Using dataset collections / Using Galaxy and Managing your Data](https://training.galaxyproject.org/training-material/topics/galaxy-interface/tutorials/collections/tutorial.html)

Let’s start there! Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![dede\_sa](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/dede_sa/32/6740_2.png) [@dede\_sa](https://help.galaxyproject.org/u/dede_sa)\
**Post date:** [February 11, 2025, 12:13pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/3 "2025-02-11T12:13:18Z")

</div>

Thanks for the reply.

As for the error message, it is “AttributeError: ‘NoneType’ object has no attribute ‘serialize’”  
The full log is bellow:

> Job Execution and Failure Information  
> **Command Line**  
> cat ‘/data/dnb10/galaxy\_db/files/f/b/a/dataset\_fbafdc58-ecb9-4525-a8dc-a52f3a6e38fd.dat’ | fastq\_to\_fasta -n -v \> ‘/data/jwd05e/main/078/947/78947242/outputs/dataset\_91665f17-bf94-428f-8466-4cb166847ab7.dat’  
> **stderr**
> 
> **stdout**
> 
> **Job Information**  
> ‘NoneType’ object has no attribute ‘serialize’  
> **Job Traceback**  
> Traceback (most recent call last):  
> File “/opt/galaxy/server/lib/galaxy/jobs/runners/ **init**.py”, line 304, in prepare\_job  
> job\_wrapper.runner\_command\_line = self.build\_command\_line(  
> ^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/jobs/runners/ **init**.py”, line 343, in build\_command\_line  
> return build\_command(  
> ^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/jobs/command\_factory.py”, line 167, in build\_command  
> \_\_handle\_metadata(commands\_builder, job\_wrapper, runner, remote\_command\_params)  
> File “/opt/galaxy/server/lib/galaxy/jobs/command\_factory.py”, line 273, in \_\_handle\_metadata  
> job\_wrapper.setup\_external\_metadata(  
> File “/opt/galaxy/server/lib/galaxy/jobs/ **init**.py”, line 2345, in setup\_external\_metadata  
> command = self.external\_output\_metadata.setup\_external\_metadata(  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/metadata/ **init**.py”, line 295, in setup\_external\_metadata  
> command = super().setup\_external\_metadata(datasets\_dict, out\_collections, sa\_session, \*\*kwd)  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/metadata/ **init**.py”, line 214, in setup\_external\_metadata  
> with DirectoryModelExportStore(  
> File “/opt/galaxy/server/lib/galaxy/model/store/ **init**.py”, line 2485, in **exit**  
> self.\_finalize()  
> File “/opt/galaxy/server/lib/galaxy/model/store/ **init**.py”, line 2368, in \_finalize  
> collections\_attrs\_out.write(to\_json(self.included\_collections.values()))  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/store/ **init**.py”, line 2349, in to\_json  
> return json\_encoder.encode([a.serialize(self.security, self.serialization\_options) for a in attributes])  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/store/ **init**.py”, line 2349, in   
> return json\_encoder.encode([a.serialize(self.security, self.serialization\_options) for a in attributes])  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 472, in serialize  
> return self.\_serialize(id\_encoder, serialization\_options)  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 7243, in \_serialize  
> collection=self.collection.serialize(id\_encoder, serialization\_options),  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 472, in serialize  
> return self.\_serialize(id\_encoder, serialization\_options)  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 6952, in \_serialize  
> elements=[e.serialize(id\_encoder, serialization\_options) for e in self.elements],  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 6952, in   
> elements=[e.serialize(id\_encoder, serialization\_options) for e in self.elements],  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 472, in serialize  
> return self.\_serialize(id\_encoder, serialization\_options)  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
> File “/opt/galaxy/server/lib/galaxy/model/ **init**.py”, line 7636, in \_serialize  
> rval[“child\_collection”] = element\_obj.serialize(id\_encoder, serialization\_options)  
> ^^^^^^^^^^^^^^^^^^^^^  
> AttributeError: ‘NoneType’ object has no attribute ‘serialize’

As I tried the workflow without fastq groomer and ended up in the same error, I added it cause I figure it might solve the problem, but it didn’t.

I will paste here the header of one of the sequences output

**ab1 to FASTQ converter**

> @baixa\_qualidade  
> TWKKWTTTTTCTTTTCATGTTTGGGTTTTTGTGCTTTTTTTTATCTTTTAATGCGTTTAGCTTTGGTTGACTTATGCTTTTATATTCTGGATATTATTAATTATGTACTTTACTGCTGTTAATGATTTTTTTTTTGAKGCCTTTWAWAAGGGGGTTACWAAYCTTTTATTCTTTAGTTTCTTTATTGAATGKGTTACCYCGATWAWAATTACTTTTGATAWATTTTTCTTTAAATTCKGTAGYCCCTTTTTTATTCGACTTCTTKGKTGAYTTAAYCYCCTATCTCTACKGYAKGTATTYYACGTTATAWWTTTCTTAWTTGSKGGSTCTCWWWTGCTCATATTWAAKWAYGTTTGATACTTTATTCTATTTCTTTTCAAYCTTATWWAGTGYCAWGCGAKTTTATATAWTCTACKGTARCRCSYAAWWGWATATGACKATTTCACTCTTTTAAATATAGGKASYTATAWYAMTTATTTGTTTTGKCMCKAKT  
> +baixa\_qualidade  
> &“”“”&&&(&&&(&&**(&(&)-961VVOW8+@72[VVVG1+01/+?111,//=4YWGG9\>C,1++\*2/**+2_A:9T-+0,0_11+6+0++(,/(+‘++,0+1_2.1[510161,6+,0-+26+11R[[\<@;300".10:R=":"6–4//._.-&"0:"71;1,’(+&)(()(-()(._+&+,1)(_“.0++/6”:52)“9"2-_1-_-7/_)_(_“+,-+62:=8…))((+”-)_(”,(+/.333/+1).)++/++)(“.”_,2"2-)'"\>"473,3)+,_“_“+”‘’_._“”)_+.-)((”“\>L01…”,(3"“,(”)),-“”“_+,1/-“+.”“0”,);0/())&.)),±&(=-?,?+(((,“30))2"”),+")",_((”+.-_,_),“_(-02",)_”)“(”“+_“”_”),)((_2"-07,_(,40,/-)(-_+)\*\*(&“&”“%$))”“(”$_,%(_._‘’“\*”&“(”$

**seqtk\_trimfq output**

> @baixa\_qualidade  
> GGTTTTTGTGCTTTTTTTTATCTTTTAATGCGTTTAGCTT  
> +  
> 961VVOW8+@72[VVVG1+01/+?111,//=4YWGG9\>C

This was a poor quality sequence that’s why it shortened a lot, but other sequences are high quality  
The output of seqtk\_trimfq is green to the tools seems to be working

 ![image](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/d/d8e2eeae1765290a0ad4fa029b8b4dcffa5850b6.png)

Running “extract element identifiers” on the seqtk\_trimfq output results in the four sequences I was using to test the workflow

baixa\_qualidade.ab1  
boa\_qualidade.ab1  
boa\_qualidade2.ab1  
media\_qualidade.ab1

I am also reving troubles adjusting the workflow. My objective was to filter ab1 sequences, than map/align the reverse primer to it to it is easier to remove primer sequences. I figure that the last workflow didn’t have a reverse complement step so I added it but now I cant concatenate the primer with the sequences in the workflow, it does not allow to connect the steps, but prior it was working fine.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/2/2898113a56baf31e5d13a847e00168cb35d4a38c.png)

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [February 11, 2025, 6:58pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/4 "2025-02-11T18:58:37Z")

</div>

Hi @dede_sa

Let’s go through these in this order if that’s ok. 🙂

First, this output looks good in some ways but not good for others. Your sequence identifier (the @ line) doesn’t have a number.

Please increase your testing data to at least four sequences, then check the @ lines. If all of the sequences have the same identifier, that can definitely lead to problems with the converter tool and any other later downstream tool.

> [@dede\_sa](#):
>
> **seqtk\_trimfq output**
> 
> > @baixa\_qualidade  
> > GGTTTTTGTGCTTTTTTTTATCTTTTAATGCGTTTAGCTT  
> > +  
> > 961VVOW8+@72[VVVG1+01/+?111,//=4YWGG9\>C
> 
> This was a poor quality sequence that’s why it shortened a lot, but other sequences are high quality  
> The output of seqtk\_trimfq is green to the tools seems to be working

Then for this one,

> [@dede\_sa](#):
>
> I am also reving troubles adjusting the workflow. My objective was to filter ab1 sequences, than map/align the reverse primer to it to it is easier to remove primer sequences. I figure that the last workflow didn’t have a reverse complement step so I added it but now I cant concatenate the primer with the sequences in the workflow, it does not allow to connect the steps, but prior it was working fine.

When you add a new tool to a workflow, you’ll need to disconnect anything down stream of that tool, then reconnect the noodles again. This is what I meant with this comment about the workflow metadata.

> [@jennaj](#):
>
> And finally, you could try disconnecting all noodles between tools in your workflow, then reconnect them in the order of tool execution. Collections have a few structures, and that “metadata” is passed through.

Your workflow has that pop-up comment in the editor because of a metadata mismatch. Adjusting the noodles is what fixes that in most cases.

Please give that a try, and if you need more help, please create a new history with just this in it: the inputs and outputs of the workflow, then the workflow itself. Having those paired together will let us debug with more specificity with your exact data.

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![dede\_sa](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/dede_sa/32/6740_2.png) [@dede\_sa](https://help.galaxyproject.org/u/dede_sa)\
**Post date:** [February 12, 2025, 12:12pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/5 "2025-02-12T12:12:06Z")

</div>

I ran the workflow two times yesterday, one using the same 4 sequences as before (Test\_same\_Seqs on history) and another one using other 4 sequences, which I didn’t change the names of the archives (Test\_raw\_files). Both times the same error happened. The raw files names had numbers and letters so I don’t know what is causing this failure, it seems something is wrong with FASTQ to FASTA using collections. Tell me if you need any access to see the histories I am talking about.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [February 12, 2025, 6:16pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/6 "2025-02-12T18:16:23Z")

</div>

Hi @dede_sa

I ran a quick test and was able to convert a collection of fastq files using three different tools that perform this manipulation.

Test started at ORG here

- [https://usegalaxy.org/u/jen-galaxyproject/h/test-fastq-to-fasta-collections](https://usegalaxy.org/u/jen-galaxyproject/h/test-fastq-to-fasta-collections)

Then I imported that over the the EU server and all three also worked

- [https://usegalaxy.eu/u/jenj/h/imported-from-archive-test-fastq-to-fasta-collections](https://usegalaxy.eu/u/jenj/h/imported-from-archive-test-fastq-to-fasta-collections)

Maybe that helps? You might need to use a different converter or perhaps the example formats show what is expected? If you need more help, you are still welcome to share your history with the small example + the workflow that created it. The links can be posted here in a reply. 🙂

---

<div class="post-metadata">

**Author:** ![dede\_sa](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/dede_sa/32/6740_2.png) [@dede\_sa](https://help.galaxyproject.org/u/dede_sa)\
**Post date:** [February 12, 2025, 7:22pm UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/7 "2025-02-12T19:22:21Z")

</div>

Thanks so much @jennaj now it worked. I changed the FASTQ to FASTA tool, using the “regular one”. The FASTQ to FASTA.FASTX was not working, not sure why.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [February 13, 2025, 12:42am UTC](https://help.galaxyproject.org/t/trouble-using-seqtk-trimfq/14691/8 "2025-02-13T00:42:14Z")

</div>

Great you have this working now @dede_sa

The FASTX toolkit version is _much_ older, and originally written for early short fastq reads. It might not work well with all of the newer sequence formats for various reasons. Nice to have this resolved! 🙂
