The delete command is used to delete objects (e.g., run, organism, mapset, map, study, qtl, marker, mapsettreenode, tracktreenode, track, storage, alignment_run) from the Persephone database. The syntax is as follows:

delete <target> <id|path> [-v | -d | (-t | -f)]

where "id" is the identifier that can be used to unambiguously find the object (see List for more information) and "path" is the path name of the object (e.g., "/Arabidopsis thaliana/test1/test2/test3"). For example, to delete a map set, use MapSetId of the corresponding map set. If you plan to delete a collection of objects, such as orthologs, synteny ribbons, or expression values, use RunId of the batch job generated when the objects were loaded. To find the proper RunId, use command

list run

(use -p pattern, if needed, to narrow down the search).

When looking for a run of particular type (e.g., orthologs), specify the type of the batch job using "-T <job type>", e.g.

list run -l -T ortholog

This "job type" is the term used after the add verb when loading the data (add annotation, add ortholog, add qtls, etc).

Note, there is no command delete track, as it would be interpreted as deleting one particular track on some map. Normally, all tracks with the same name are deleted from a map set, hence, to delete all tracks with a given name from the map set, use command delete tracktreenode

Delete Command Parameters

The table below lists the definitions for the delete command parameters. Please note you must use either the "id" or "path" but not both.

Parameter

Required or Optional?

Definition

{target}

Required

A target is the object type you want to delete, which can be run, organism, mapset, map, study, qtl, marker, mapsettreenode, tracktreenode, track, storage, alignment_run, annotation_qualifier, annotation_search

id

or
path

Required

  • id. Depending on the target it could be RunId or MapSetId or other ID. The RunID is the ID of the run that added the object you want to delete. Use the List command to identify the RunId number. (See List for more information.)
  • path. The path name of the object you want to delete (e.g., "/Arabidopsis thaliana/test1/test2/test3") Please note you must use double quote marks (") if the path contains any spaces.

-v

Optional

Executes the delete command in verbose mode.

-t

Optional

Executes the delete command in test mode.

-d

Optional

Executes the delete command in debug mode. You can send the debug output to Persephone Software, LLC. at http://persephonesoft.com/contact.

-f

Optional

Executes the delete command in "force" mode, which bypasses the confirmation prompt in interactive mode.

It is good practice to test (-t) the delete operation before execution. The test will print the list of objects to be deleted:

PS> delete run 35 -t
This operation will affect:
  - 12869 mappings
  - 10 tracks
  - 12869 markers

run 35 can be removed.

Deleting a Target with a RunId

Sometimes, the only way to delete objects is to use their RunId. For example, the orthologs loaded in one batch will have the same RunId. It is also typical to use RunId for removing the synteny ribbons or gene expression values. To delete a target with a RunId enter 'delete run' followed by  the RunId number. For example, to delete markers that were added in RunId 35, enter the following:

PS> delete run 35 -v

The following message will be displayed.

PS> delete run 35 -v
This operation will affect:
  - 12869 mappings
  - 10 tracks
  - 12869 markers

Do you want to delete the markers? (Y/N)

 Confirm the deletion if the numbers of the objects to be deleted match your expectations.

Tip

As described above, you can use the List command to determine the RunId number. See Deleting Loaded Data for an example of using the List and Delete commands together.

Deleting a Target with a Path

To delete a target with a path, enter delete followed by the target type and the path name. For example, to delete a map set tree node with a path "/Arabidopsis thaliana/test1/test2/test3", enter the following:

PS> delete mapsettreenode "/Arabidopsis thaliana/test1/test2/test3"

The following message will be displayed.

Mapsettreenodes: "/Arabidopsis thaliana/test1/test2/test3" have been successfully deleted.

 

Note

You must enter the entire path name for a target to be deleted - a map set or a track tree node (wildcards are not supported). Remember that you can use auto-completion using Tab key.

Deleting Track Tree Nodes

A track tree describes the hierarchical organization of the tracks for a map set (remember, they can be grouped), and deleting one of the "track nodes" is spelled as delete tracktreenode.

delete tracktreenode <MapSetId|path> [-v|-d|{-t|-f}]

Before actually deleting the records from the database, the program will ask for the confirmation. It is highly recommended to either test the command by using the switch -t or to execute it with the verbose output (-v), where PersephoneShell will first list the number of objects scheduled for deletion and will confirm the deletion.


PS> delete tracktreenode "Arabidopsis thaliana/TAIR10" -v
TrackTree for MapSet 'TAIR10':

[0] Ensembl (Track, Order: 0, Type: Annotation)
[1] TREP repeats (Track, Order: 1, Type: GenericBp)
[2] SV-deletions (Track, Order: 2, Type: GenericBp)
[3] SV-insertions (Track, Order: 3, Type: GenericBp)
[4] RNA-seq (Group, Order: 4)
    [5] RNA-seq cold treatment (Track, Order: 4, Type: Quantitative)
    [6] RNA-seq cold-stress control (Track, Order: 5, Type: Quantitative)

Enter [NodeNumber] to delete? 1
This operation will affect:
  - 45 mappings
  - 5 tracks

Do you want to delete the tracks? (Y/N) Y


A track tree node name can be a part of the object's path. For example, if a map set "TAIR10" has a track "gene models", the full path on the command line would be "/Arabidopsis thaliana/TAIR10/gene models". The auto-completion will help you assemble the path that includes the track names.

Deleting Annotation Qualifiers

Sometimes, there is the need to remove some uninformative or erroneously loaded gene model qualifiers. The command for this is:

delete annotation_qualifier <MapSetId|path> [-t] [-d]

It will list all qualifiers available for all annotation tracks and ask to select the corresponding line.


PS> delete annotation_qualifier "/Homo sapiens/GRCh38"
Deleting qualifiers in map set /Homo sapiens/GRCh38
Qualifiers with example values:

Track 'Ensembl':
[0]          Name ( 95,224 records) : A1BG
[1]   description ( 94,434 records) : 1,4-alpha-glucan branching enzyme 1 [Source:HGNC Symbol;Acc:HGNC:4180]
[2]       gene_id ( 95,224 records) : ENSG00000000003

Track 'GENSCAN':
[3]          Name ( 46,548 records) : GENSCAN00000000001

Track 'Gnomon gene models':
[4]        Dbxref (113,756 records) : GeneID:1,Genbank:NM_130786.3,HGNC:HGNC:5,MIM:138670
[5]          Name (113,756 records) : NM_000014.5
[6]          gene (113,756 records) : A1BG
[7]       product (113,756 records) : 1,4-alpha-glucan branching enzyme 1
[8] transcript_id (113,756 records) : NM_000014.5

Type the line [number] with qualifier to delete: 3
Deleting 46548 qualifiers named Name on track GENSCAN. Proceed? (Y/N) Y
Annotation qualifiers have been removed
DATA_VERSION updated