Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • ln -s <path> says to create a symbolic link link (symlink) to the specified file (or directory) in the current directory
    • always use the -s option to avoid creating a hard link, which behaves quite differently
  • the default link name corresponds to the last name component in <path>
    • you can name the link file differently by supplying an optional link_file_name.
  • it is best to change into (cd) the directory where you want the link before executing ln -s
  • a symbolic link can be deleted without affecting the linked-to file
  • the -f (force) option says to overwrite any existing symbolic link with the same name

...

  • find returns a list of matching file paths on its standard output
  • ln wants its files listed as arguments, not on standard input
    • so the paths are piped to the standard input of xargs
  • xargs takes the data on its standard input and calls the specified function (here ln -sf -t .) with that data as the function's argument list.

...

Expand
titleAnswer...

The cutadapt usage says an input.fastq file is a required argument:

    cutadapt -a ADAPTER [options] [-o output.fastq] input.fastq

But again, reading a bit further we see:

...                           Compressed input and output is supported and
auto-detected from the file name (.gz, .xz, .bz2). Use the file name '-' for
standard input/output. ...

This says that the input.fastq file can be provided in one of three compression formats.

And the usage also suggests input can be specified in 2 ways:

  • from a file, using the -o option
    • cutadapt -a CGTAATTCGCG -o trimmed.fastq  small.fq
  • from standard input if the input.fastq argument is replaced with a dash ( - )
    • cat small.fq | cutadapt -a CGTAATTCGCG -o trimmed.fastq  -
And also says that the input.fastq file can be provided in one of three compression formats.

Where does cutadapt write its diagnostic output by default? How can that be changed?

Expand
titleAnswer...

The cutadapt usage doesn't say anything directly about diagnostics:

    cutadapt -a ADAPTER [options] [-o output.fastq] input.fastq

But again, reading in the Output: options section:

   -o FILE, --output=FILE
        Write trimmed reads to FILE. FASTQ or FASTA format is
        chosen depending on input. The summary report is sent
        to standard output. Use '{name}' in FILE to
        demultiplex reads into multiple files. Default: write
       
to standard output

Careful reading of this suggests that:

  • When the -o option is omitted, and output goes to standard output,
    • diagnostics must be written to standard error
      • so can be redirected to a log file with 2> trim.log
    • cutadapt -a CGTAATTCGCG small.fq 1> trimmed.fastq 2> trim.log
  • But when the trimmed output is sent to a file with the -o output.fastq option,
    • diagnostics are written to standard output
      • so can be redirected to a log file with 1> trim.log
    • cutadapt -a CGTAATTCGCG -o trimmed.fastq  small.fq 1> trim.log

...