Cutadapt All Samples Exercise (Breakout)


15 Minutes


Now that we’ve learned the basics of running Cutadapt, we need to trim all the rest of our samples. If you remember from the Computational Foundations course, we learned about using bash variables. Let’s try an exercise where we use a bash variable to trim each one of our FASTQ files.


Instructions:


  • One group member should share their screen in the breakout room. If nobody volunteers, a helper may randomly select someone.
  • The group members should discuss the exercise and work together to find a solution.
  • After a solution is found, allow time for all members to complete the exercise.


  • Review Cutadapt’s help page and choose the proper arguments for our Cutadapt command(s).
  • Use a bash variable along with Cutadapt to trim all remaining FASTQ files.
  • Confirm that we have all of our expected output files.


Hint: Using a bash variable allows us to quickly change some arguments in a repeated command, e.g. :

noun="World"
echo "Hello, $noun!"
noun="Class"
echo "Hello, $noun!"
LS0tCnRpdGxlOiAiRGF5IDEgLSBCcmVha291dCAwMSIKYXV0aG9yOiAiVU0gQmlvaW5mb3JtYXRpY3MgQ29yZSIKb3V0cHV0OgogICAgICAgIGh0bWxfZG9jdW1lbnQ6CiAgICAgICAgICAgIGluY2x1ZGVzOgogICAgICAgICAgICAgICAgaW5faGVhZGVyOiBoZWFkZXIuaHRtbAogICAgICAgICAgICB0aGVtZTogcGFwZXIKICAgICAgICAgICAgZmlnX2NhcHRpb246IHRydWUKICAgICAgICAgICAgbWFya2Rvd246IEdGTQogICAgICAgICAgICBjb2RlX2Rvd25sb2FkOiB0cnVlCi0tLQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgpib2R5eyAvKiBOb3JtYWwgICovCiAgICAgIGZvbnQtc2l6ZTogMTRwdDsKICB9CnByZSB7CiAgZm9udC1zaXplOiAxMnB0Cn0KPC9zdHlsZT4KCjxicj4KCiMjIEN1dGFkYXB0IEFsbCBTYW1wbGVzIEV4ZXJjaXNlIChCcmVha291dCkKCjxicj4KCioqMTUgTWludXRlcyoqCgo8YnI+CgpOb3cgdGhhdCB3ZSd2ZSBsZWFybmVkIHRoZSBiYXNpY3Mgb2YgcnVubmluZyBDdXRhZGFwdCwgd2UgbmVlZCB0byB0cmltI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