Skip to contents

This function adds PolyPhen-2 predictions to the MOVA input file. This function is required to create the input files needed for MOVA functions.

Usage

Edit_polyphen_data(dbNSFP4.3a_final_file, input_file_name1, input_file_name2, uniprot_name, position1, position2, export_file_name1, export_file_name2)

Arguments

dbNSFP4.3a_final_file

Path of the dbNSFP4.3a_variant file for the Chromosome in which the gene resides.

input_file_name1

Path of export_file_name output by the Edit_variant_data function.

input_file_name2

Path of "gene name_alph.csv" output by the Edit_variant_data function.

uniprot_name

uniprot name of target protein

position1

Lower limit position of the targeted gene (hg38)

position2

Upper limit position of the targeted gene (hg38)

export_file_name1

Name of output file 1

export_file_name2

Name of output file 2

Details

Value

References

Author

Yuya Hatano

Note

See also

Examples

Hgmd_divide("./source/TARDBP.csv")
Edit_gnomAD_file("./source/gnomAD_v3.1.2_ENST00000240185_2023_02_14_13_23_48.csv", "./source/TARDBP_gnomAD.csv")
Edit_variant_data("../CADD_REVEL/AlphScore_final.tsv", "./source/TARDBP.csv", "./source/TARDBP_gnomAD.csv", "Q13148", "TARDBP", "./source/TARDBPvariantdata.csv")
Edit_polyphen_data("../dbNSFP/dbNSFP4.3a/dbNSFP4.3a_variant.chr1","./source/TARDBPvariantdata.csv", "TARDBP_alph.csv",  "Q13148",  11012654, 11025492 ,"./source/TARDBPvariantdatapol.csv", "./source/TARDBP_alphpol.csv")
Edit_final_variant_file("./source/TARDBP_alphpol.csv","./source/TARDBP_alphpol2.csv")
MOVA("./source/Q13148.fa", "TARDBP", "./source/AF-Q13148-F1-model_v2.pdb","./source/TARDBP_alphpol2.csv", "./source/TARDBPvariantdatapol.csv")

## The function is currently defined as
function (dbNSFP4.3a_final_file, input_file_name1, input_file_name2, 
    uniprot_name, position1, position2, export_file_name1, export_file_name2) 
{
    D <- fread(dbNSFP4.3a_final_file)
    head(D)
    colnames(D)[1] <- "Chromosome"
    colnames(D)[2] <- "Position"
    colnames(D)[3] <- "Reference"
    colnames(D)[4] <- "Alternate"
    dren <- D[(D$Position <= position2) & (D$Position >= position1), 
        ]
    dt <- data.table(Chromosome = dren$Chromosome, Position = dren$Position, 
        Reference = dren$Reference, Alternate = dren$Alternate, 
        Uniprot_acc = dren$Uniprot_acc, Polyphen_prob = dren$Polyphen2_HDIV_score)
    Uniplot_v <- str_split(dt$Uniprot_acc, pattern = ";", simplify = TRUE)
    Polyphen2_HDIV_v <- str_split(dt$Polyphen_prob, pattern = ";", 
        simplify = TRUE)
    dt$pph_prob <- ""
    i <- 1
    while (i < nrow(dt)) {
        CHm <- match(uniprot_name, Uniplot_v[i, ])
        if (is.na(CHm) == FALSE) {
            dt$pph_prob[i] <- Polyphen2_HDIV_v[i, CHm]
            i <- i + 1
        }
        else {
            dt <- dt[-i, ]
            Uniplot_v <- Uniplot_v[-i, ]
            Polyphen2_HDIV_v <- Polyphen2_HDIV_v[-i, ]
        }
    }
    dt[, `:=`(Uniprot_acc, NULL)]
    dt[, `:=`(Polyphen_prob, NULL)]
    dat <- fread(input_file_name1)
    pph_data <- merge(dat, dt)
    fwrite(pph_data, export_file_name1)
    dat <- fread(input_file_name2)
    pph_data <- merge(dat, dt)
    fwrite(pph_data, export_file_name2)
  }
#> function (dbNSFP4.3a_final_file, input_file_name1, input_file_name2, 
#>     uniprot_name, position1, position2, export_file_name1, export_file_name2) 
#> {
#>     D <- fread(dbNSFP4.3a_final_file)
#>     head(D)
#>     colnames(D)[1] <- "Chromosome"
#>     colnames(D)[2] <- "Position"
#>     colnames(D)[3] <- "Reference"
#>     colnames(D)[4] <- "Alternate"
#>     dren <- D[(D$Position <= position2) & (D$Position >= position1), 
#>         ]
#>     dt <- data.table(Chromosome = dren$Chromosome, Position = dren$Position, 
#>         Reference = dren$Reference, Alternate = dren$Alternate, 
#>         Uniprot_acc = dren$Uniprot_acc, Polyphen_prob = dren$Polyphen2_HDIV_score)
#>     Uniplot_v <- str_split(dt$Uniprot_acc, pattern = ";", simplify = TRUE)
#>     Polyphen2_HDIV_v <- str_split(dt$Polyphen_prob, pattern = ";", 
#>         simplify = TRUE)
#>     dt$pph_prob <- ""
#>     i <- 1
#>     while (i < nrow(dt)) {
#>         CHm <- match(uniprot_name, Uniplot_v[i, ])
#>         if (is.na(CHm) == FALSE) {
#>             dt$pph_prob[i] <- Polyphen2_HDIV_v[i, CHm]
#>             i <- i + 1
#>         }
#>         else {
#>             dt <- dt[-i, ]
#>             Uniplot_v <- Uniplot_v[-i, ]
#>             Polyphen2_HDIV_v <- Polyphen2_HDIV_v[-i, ]
#>         }
#>     }
#>     dt[, `:=`(Uniprot_acc, NULL)]
#>     dt[, `:=`(Polyphen_prob, NULL)]
#>     dat <- fread(input_file_name1)
#>     pph_data <- merge(dat, dt)
#>     fwrite(pph_data, export_file_name1)
#>     dat <- fread(input_file_name2)
#>     pph_data <- merge(dat, dt)
#>     fwrite(pph_data, export_file_name2)
#>   }
#> <environment: 0x0000011a811a2f00>