Delete
The delete command is used to delete objects (alignment_run, annotation_qualifier, annotation_search, map, mapset, mapsettreenode, organism, orphan_marker, orphan_variant, ortholog, qtl, run, study, tracktreenode, variant) 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/TAIR10"). For example, to delete a map set, use MapSetId of the corresponding map set.
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 together, hence, to delete all tracks with a given name from the map set, use the 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 annotation_qualifier, annotation_search, map, mapset, mapsettreenode, organism, orphan_marker, orphan_variant, ortholog, qtl, run, study, synteny, tracktreenode, variant |
id or |
Required |
|
-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 https://persephonesoft.com/contact. |
-f |
Optional |
Executes the delete command in "force" mode, which bypasses the confirmation prompt in the interactive mode. |
It is a 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. To delete a target with a RunId enter delete run followed by the RunId number. For example, to delete markers that were added with the command add marker that was assigned a RunId 35, enter the following:
PS> delete run 35
The following message will be displayed.
PS> delete run 35
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.
Deleting /Arabidopsis thaliana/test1/test2/test3
Do you want to delete the mapsettreenode? (Y/N) Y
1 MapSetTree node(s) have been deleted or orphaned.
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 first list the number of objects scheduled for deletion and will ask for the confirmation.
PS> delete tracktreenode "Arabidopsis thaliana/TAIR10"
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
Deleting Orthologs
All ortholog pairs between genes in two map sets are stored in one database record and will be deleted together. To specify RecordId of the ortholog set, either run the list ortholog command or execute the delete command in the interactive mode. The command will list all ortholog records with their respective RecordIds.
PS> delete ortholog
[##] Record ID From mapset To mapset Count
---------------------------------------------------------------------------
[0] 2 Jamaican Lion DASH [19] Jamaican Lion DASH [19] 23,609
[1] 7 USDA_Vadar_1.0_pri [3] glyma22xx [12] 15,498
[2] 8 C.lanatus Cla97_v1 [15] C.sativus 9930 [16] 17,020
[3] 12 glyma22xx [12] C.lanatus Cla97_v1 [15] 14,556
Enter [lineNo] to delete:
If you know RecordId in advance, it can be specified on the command line:
PS> delete ortholog 8 -f
Note that using the force switch (-f) will skip the confirmation question and enable you to delete orthologs from a script or an OS prompt:
$ psh delete ortholog 8 -f
Deleting Variants
The variant data loaded from VCF files can be deleted with the command delete variant. This command will first list all available variant records identified by VcfId. It is possible to delete all or selected samples from a VCF record.
PS> delete variant
[##] VcfId MapSetId RunId Version Original path
-----------------------------------------------------------------------------------------------------------------------------------------
[0] 13 2 1049 2 /HDD4Gb/bio/data/rice/ordered_rice3K.vcf.gz
[1] 14 17 1050 2 /HDD4Gb/bio/data/sorghum/Sbicolor_Patterson_454.vcf.gz
[2] 16 10 1062 2 /HDD4Gb/bio/data/human/vcf/ALL.chr6.shapeit2_integrated_v1a.GRCh38.20181129.phased.vcf.gz
[3] 19 195 1636 10 /HDD4Gb/OpenplantsBio/wheat/SNPs_lifted_final2_sorted_v1.vcf.gz/SNPs_lifted_final2_sorted_v1.vcf
Select [lineNo(s)] corresponding to the VCF(s) to delete?
Once the line is selected, the program will prompt to choose to list the samples to delete (A-all or S-selected only):
Select [lineNo(s)] corresponding to the VCF(s) to delete? 1
Selected:
- /HDD4Gb/bio/data/sorghum/Sbicolor_Patterson_454.vcf.gz
Do you want to delete all (A) records or selected samples (S) (Esc to cancel)?
[##] SampleId SnpCount Name
--------------------------------------
[0] 36291 3,479,100 Ajabsido
[1] 36301 3,910,353 Cowley
[2] 36308 3,925,233 GrassI
[3] 36307 3,485,336 IS3620c
[4] 36298 3,954,805 Macia
[5] 36300 3,909,384 P898012
[6] 36310 3,899,132 PI 505722
[7] 36311 3,869,644 PI 506069
[8] 36312 3,865,194 PI 508366
[9] 36289 3,118,806 RTx430
[10] 36296 3,021,708 SC1103
[11] 36299 3,928,383 SC1345
[12] 36302 3,472,934 SC155
[13] 36294 3,523,368 SC265
[14] 36295 3,032,738 SC283
[15] 36292 3,584,287 SC35
[16] 36303 3,947,603 SC748
[17] 36293 3,450,788 SC971
[18] 36297 3,942,779 Segaolane
[19] 36309 3,911,565 Top76-6
[20] 36304 3,623,074 Tx399
[21] 36305 3,749,471 Tx631
[22] 36290 3,903,331 Tx642
Select samples by [lineNo] (0,2,10..20)?
Optionally, VcfId can be provided on the command line. In that case, the force flag (-f) should be used and all samples for the given VCF will be deleted.
delete variant 14 -f
Deleting Synteny Ribbons
The synteny ribbons between two map sets share the same RunId and can be deleted by either the command delete run or delete synteny. The command delete synteny will present a list of the synteny records to delete and will ask to select the line numbers.
[##] RUN_ID FROM MAP SET TO MAP SET #RIBBONS
--------------------------------------------------------------------------------------------------------
[0] 638 [169] O. glaberrima [170] O. barthii 73
[1] 639 [171] O. punctata [170] O. barthii 204
[2] 640 [165] O. rufipogon [170] O. barthii 186
[3] 641 [152] Os cB: ARC 10497 [170] O. barthii 184
[4] 642 [156] Os XI-2B: LARHA MUGAD [170] O. barthii 184
[5] 1326 [244] American blueberry ASM1450483v1 [242] USDA_Vadar_1.0_pri 3,915
[6] 2237 [26] DM_v4.03 [212] DM 1-3 516 R44 2,462
[7] 2238 [26] DM_v4.03 [397] Solanum etuberosum v1.2 7,925
Select synteny row by [lineNo] (0,2,10..20)?
Please note that you can type multiple line numbers and delete several synteny runs.
If you know the RunId of the synteny data set, it can be provided on the command line:
delete synteny 22