Samples

Overview

A sample holds the sequencing reads from one library. You use samples to start analyses.

To open samples, click Samples in the main navigation bar. The sidebar has these pages:

  • Browse: the list of samples.
  • Files: the read files that are uploaded to Virtool.
  • Labels: the labels that you can give to samples.
  • Settings: the default rights for new samples. Only full administrators see this page.

What happens during sample creation?

When you create a sample, Virtool starts a Create Sample job. The job keeps the read files with the sample and calculates quality data from the reads.

The sample shows Creating in the samples list until the job is complete. When the sample is ready, you can see its files and quality data, and you can start analyses.

Browse samples

The samples list shows 25 samples on each page. Each row shows the name, library type, labels, workflow status, creation time, and the user that created the sample.

To find samples:

  1. Type part of a sample name in the search box.

  2. Use the filters below the search box to make the list smaller:

    • Labels: samples that have the selected labels.
    • Workflows: samples with a Pathoscope or Nuvs status of Not analyzed, In progress, or Complete.
    • Created: samples created in a month, a year, or a range of dates.
    • Users: samples created by the selected users.
    • Groups: samples owned by the selected groups.
  3. To remove a filter, click the remove control on its chip.

If no samples match, click Clear filters to remove all the filters.

To sort the list, click the Name, Created, or User column header. Click the header again to change the sort direction. By default, the newest samples are at the top.

The workflow tags in each row show the status of each workflow for the sample. Click a tag to open the Analyses tab of the sample.

Click a sample name to open the sample.

Select samples

Select the checkbox at the start of a row to select a sample. Hold Shift and click a second checkbox to select all the samples between the two. Select the checkbox in the header to select all the samples on the page.

Your selection stays when you go to a different page of the list. It clears when you change the search or the filters.

When you select samples, these actions show above the list:

  • Labels: add labels to the selected samples, or remove labels from them.
  • Analyze: start an analysis on the selected samples.

Start quick analysis

Quick analysis starts the same analysis on one or more samples at the same time.

  1. Open the Quick Analyze dialog. Do one of these steps:

    • In the samples list, select the samples and click Analyze.
    • Click Quick analyze at the end of the row of a ready sample.

    Four samples selected in the Samples list

  2. Make sure that the list of samples is correct.

  3. Under Workflow, select Pathoscope or Nuvs.

    Nuvs is available only when HMM data is installed. See HMMs.

  4. Under Subtractions, select the subtractions that you want to use.

    If you analyze one sample, the dialog selects the default subtractions of that sample. If you analyze more than one sample, the dialog does not select subtractions.

  5. Under Reference, select one reference.

    The dialog shows the number of jobs that will start. Virtool starts one job for each sample.

  6. Click Create.

    The Quick Analyze dialog with four samples selected

To start more analyses from the same dialog, turn on Create more before you click Create. The dialog then stays open.

Upload read files

You must upload read files before you can create a sample.

  1. In the sidebar, click Files.
  2. Drag the files to the upload area, or click Browse Files and select them.

Virtool accepts FASTQ files that are plain, gzip compressed, or bzip2 compressed. A file name must end in .fq or .fastq, optionally followed by .gz or .bz2.

Files that are larger than the maximum upload size of your Virtool instance are rejected. Virtool shows the maximum size when it rejects a file.

You must have the upload_file permission to upload files. To delete files, select them and click Delete. You must have the remove_file permission to delete files.

Track uploads

When an upload starts, the Uploads panel opens in the bottom-right corner. The nav bar shows an upload icon and the total progress as a percentage. Click the icon to show or hide the panel. The panel does not close by itself.

The top of the panel shows the status of all the uploads:

  • The time remaining and the upload speed.
  • Finishing uploads when all the data is sent and Virtool is processing the files.
  • Uploads complete when all the uploads are complete.

Each file in the panel shows its own status:

  • In progress: a progress bar. Click Cancel to stop the upload.
  • Finishing: a spinner. All the data is sent and Virtool is processing the file.
  • Complete: a green check.
  • Failed: the error in red. Click Retry to upload the file again, or click Remove to remove it from the panel.

Completed uploads stay in the panel until you start a new upload.

Paired reads

A sample is unpaired if it has one read file. A sample is paired if it has two read files: one for each mate. Interleaved FASTQ files are not supported.

Virtool finds the two files of a pair from their names. The names must be the same except for a mate token, for example _R1 and _R2, _1 and _2, or .1. and .2.. The file with 1 is the LEFT read and the file with 2 is the RIGHT read.

Create a sample

You must have the create_sample permission to create a sample.

  1. In the samples list, click Create.

  2. Under Read files, select the read files for the sample.

    The selector has two modes:

    • Auto-pair: each pair of files shows as one row. Click a row to select the pair or the file.
    • Manual: each file shows on its own row. Click up to two files. To change the order of the LEFT and RIGHT files, click Swap reads.

    Virtool shows a warning if the name of a selected file looks like it belongs in the other slot.

  3. Type a unique Name for the sample. To use the name of the read files, click Auto Fill.

  4. Select a User Group.

    The group is used only when an administrator sets the sample group to Force choice. See Settings.

  5. Optional: click Show Metadata Fields and type the Locale, Isolate, and Host.

  6. Select the Library Type: Normal or sRNA.

  7. Optional: select Labels for the sample.

  8. Select the Default Subtractions.

    Use the subtractions that are most closely related to the host of the sample. Virtool selects them for you when you start an analysis of only this sample.

  9. Click Save.

Virtool starts the sample creation job and opens the samples list. The new sample shows Creating until the job is complete.

To create more samples from the same page, turn on Create more before you click Save. To clear the form, click Reset Form.

Sample names must be unique. Virtool shows an error if the name is already in use.

Create samples from files

You can also create samples on the Files page.

To create one sample from one file, click Create sample in the row of the file. If Virtool finds the mate of the file, the sample uses both files.

To create many samples at the same time:

  1. Select the read files.

  2. Click Create Samples.

    Virtool makes one sample for each file or pair of files. Each sample gets a name from its files.

  3. Change the sample names if necessary. To change many names at the same time, use the rename tools above the list:

    1. Type the text to find in Match.
    2. Type the new text in Replacement. Leave it empty to remove the matching text.
    3. Click Replace in followed by the number of names.

    Matching is case-sensitive. Use * to match any number of characters. To use a regular expression, click Use regular expression. Click Undo rename to undo the last rename.

  4. To remove a sample from the batch, click Remove in its row.

  5. Set the fields that apply to every sample: User Group, metadata, Library Type, Labels, and Default Subtractions.

  6. Click Create followed by the number of samples, for example Create 4 samples.

You can’t create the samples while two samples have the same name or a name is empty.

Sample details

A sample has these tabs:

  • General: the metadata, library information, and notes of the sample.
  • Files: the read files of the sample.
  • Quality: charts of the read quality.
  • Analyses: the analyses of the sample. See Analyses.
  • The tab with the key icon: who can read and change the sample. Only users with write rights on the sample see this tab.

Only the General tab is available while the sample is being created.

The General tab shows these library values: Encoding, Read Count, Library Type, Length Range, GC Content, and Paired.

Virtool shows a warning if a read file of the sample is smaller than 10 MB. Make sure that you used the correct files.

Labels and default subtractions

The sidebar of the General tab shows the Labels and Default Subtractions of the sample. To change them, click the edit control beside the heading and select or clear items in the list. Click Manage to open the labels or subtractions page.

Edit a sample

  1. Open the sample and go to the General tab.
  2. Click Modify beside the sample name.
  3. Change the Name, Isolate, Host, Locale, or Notes.
  4. Click Save.

Notes support Markdown. The notes show on the General tab.

You must have write rights on the sample to edit it.

Delete a sample

  1. Open the sample and go to the General tab.
  2. Click Delete beside the sample name.
  3. Click Confirm.

You can delete a sample when it is ready, or when its creation job failed or was cancelled. You must have write rights on the sample to delete it.

Download a read file

  1. Open the sample and go to the Files tab.
  2. Under Reads, click the name of the file.

The download is the read file that was used to create the sample.

Some older samples keep only trimmed reads. For these samples, Virtool shows a message. To analyze untrimmed reads, create the sample again.

Interpreting sample quality

Virtool calculates quality data from the reads when it creates the sample. Go to the Quality tab to see three charts.

Quality distribution and nucleotide composition charts for a sample

Quality distribution at read positions

This chart shows the quality score at each read position. A higher score is better. The chart shows the mean, the median, the quartiles, and the deciles. Quality usually decreases near the end of the reads.

A median below 25 or a lower quartile below 10 is a cause for concern.

Nucleotide composition at read positions

This chart shows the percentage of guanine, adenine, thymine, and cytosine at each read position. In a diverse library, the percentages do not change much between positions, so the lines are almost parallel. The overall composition depends on the library. For example, viral genomes can be rich in A and T.

Read-wise quality occurrence

This chart shows the number of reads for each mean read quality. Virtool calculates the mean quality of all the bases in each read.

A good library shows one sharp peak at a high quality, with few reads of low quality. A mean quality below 27 is a cause for concern.

Labels

Labels help you sort and find samples. Each label has a name, a color, and an optional description.

To manage labels, click Labels in the sidebar.

  • To create a label, click Create. Type a Name, an optional Description, and select a Color. Click Save.
  • To change a label, click Edit label in its row.
  • To delete a label, click Delete in its row and confirm.

You can give labels to a sample when you create it, on its General tab, or to many samples from the samples list.

Rights

Rights control who can read and change a sample.

Levels

Rights apply at four levels:

Level Rights
Administrators Full administrators can read and change all samples, and can change the rights of all samples.
Owner The user that created the sample can always read and change it, and can change its rights.
Group Members of the group that owns the sample get the group rights.
All users All users of the Virtool instance get the all users’ rights.

A sample can have no owner group. Then the group rights have no effect.

Owner groups let more than one team keep their samples private on one Virtool instance.

Rights values

Value Effect
None Users can’t see the sample in the samples list or open it.
Read Users can see the sample, its files, its quality data, and its analyses. They can’t change it.
Read & write Users can also edit and delete the sample and start analyses.

Change the rights of a sample

Only the owner of the sample or a full administrator can change its rights.

  1. Open the sample.
  2. Click the tab with the key icon.
  3. Select the Group that owns the sample, or None.
  4. Select the Group Rights.
  5. Select the All Users’ Rights.

Virtool saves each change immediately.

Settings

Full administrators can set the default rights for new samples. Click Settings in the sidebar of the samples pages. Virtool saves each change immediately.

The settings do not change samples that already exist.

Sample group

This setting controls which group owns a new sample.

Option Effect
None The sample has no owner group. Only the all users’ rights apply.
Force choice The user selects the owner group when they create the sample.
User’s primary group The sample gets the primary group of the user that creates it.

Group rights

This setting is the default rights of the owner group: None, Read, or Read & write. It has no effect when the sample has no owner group.

All users’ rights

This setting is the default rights of all users: None, Read, or Read & write.

The owner of a sample and full administrators can change the rights of one sample at any time.