read_raw_file()
function reads in a user provided protein NMR experimental peak list. It currently supports file format in csv, txt with deliminator of comma, whitespace or semicolon.
Note: please don't leave space between sequence and chemical shifts data, otherwise it will report error.R/utility.R
read_raw_file.Rd
Extracts data from a protein NMR experimental peak list.
read_raw_file()
function reads in a user provided protein NMR experimental peak list. It currently supports file format in csv, txt with deliminator of comma, whitespace or semicolon.
Note: please don't leave space between sequence and chemical shifts data, otherwise it will report error.
read_raw_file(file_path, delim = "comma", assigned = FALSE)
file_path | File path where input chemical shifts file is located |
---|---|
delim | Delimiter for parsing file |
assigned | Flag tell whether the input chemical shifts file is already assigned or not |
A list contains protein sequence and chemical shift table.
input_type = "ws" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input_ws.txt", delim="ws"))#>#> #> #> #>#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 32 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 22 more rows #>unlink("sample_input_ws.txt") input_type = "csv" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input.csv", delim="comma"))#>#> #> #> #>#> Warning: number of columns of result is not a multiple of vector length (arg 2)#> Warning: 1 parsing failure. #> row # A tibble: 1 x 5 col row col expected actual file expected <int> <chr> <chr> <chr> <chr> actual 1 33 <NA> 2 columns 1 columns 'sample_input.csv' file # A tibble: 1 x 5#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 33 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 23 more rows #>unlink("sample_input.csv") input_type = "sc" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input_sc.txt", delim="semicolon"))#>#> #> #> #>#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 32 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 22 more rows #>unlink("sample_input_sc.txt")