viola.Vcf.rename_info

Vcf.rename_info(table_name, value, safety_mode=True)

Rename INFO name of this object.

Parameters
  • table_name (str) – Current table name.

  • value (str) – A New table name.

  • safety_mode (bool) – Protect against potentially destructive renaming.

Return type

None

Examples

>>> import viola
>>> from io import StringIO
>>> DATA = """DATA_manta = """##fileformat=VCFv4.1
    ##contig=<ID=chr1,length=195471971>
    ##INFO=<ID=TEST,Number=1,Type=String,Description="Test INFO">
    ##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
    ##INFO=<ID=SVLEN,Number=.,Type=Integer,Description="Difference in length between REF and ALT alleles">
    ##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the variant described in this record">
    ##INFO=<ID=CIPOS,Number=2,Type=Integer,Description="Confidence interval around POS">
    ##INFO=<ID=CIEND,Number=2,Type=Integer,Description="Confidence interval around END">
    ##INFO=<ID=EVENT,Number=1,Type=String,Description="ID of event associated to breakend">
    ##FORMAT=<ID=PR,Number=.,Type=Integer,Description="Spanning paired-read support for the ref and alt alleles in the order listed">
    ##ALT=<ID=DEL,Description="Deletion">
    #CHROM      POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  mouse1_N        mouse1_T
    chr1        82550461        test1   G       <DEL>   .       .       TEST=test;SVTYPE=DEL;SVLEN=-3764;END=82554225;CIPOS=-51,52;CIEND=-51,52 PR      21,0    43,4
    """
>>> vcf = viola.read_vcf(StringIO(DATA), patient_name='patient1')
>>> print(vcf)
INFO=test,svtype,svlen,end,cipos,ciend,event
Documentation of Vcf object ==> https://dermasugita.github.io/ViolaDocs/docs/html/reference/vcf.html
    id            be1            be2 strand  qual svtype
0  test1  chr1:82550461  chr1:82554226     +-  None    DEL
>>> vcf.rename_info('test', 'renamed')
>>> print(vcf)
INFO=renamed,svtype,svlen,end,cipos,ciend,event
Documentation of Vcf object ==> https://dermasugita.github.io/ViolaDocs/docs/html/reference/vcf.html
    id            be1            be2 strand  qual svtype
0  test1  chr1:82550461  chr1:82554226     +-  None    DEL