Entering edit mode
Tereza Jezkova UNLV
▴
20
@tereza-jezkova-unlv-5934
Last seen 10.2 years ago
I created a Snp matrix using a genotypeToSnpMatrix command
The matrix looks like this:
> mat
$genotypes
A SnpMatrix with 10 rows and 50581 columns
Row names: Rodriguez_Lizard_1240_sequence_1_pileup.txt ...
Rodriguez_Lizard_623_sequence_1_pileup.txt
Col names: RADid_0000001_depth_39:0000000058 ...
RADid_0078132_depth_33:0000000081
$map
DataFrame with 50581 rows and 4 columns
snp.names allele.1
allele.2 ignore
<character> <dnastringset>
<dnastringsetlist> <logical>
1 RADid_0000001_depth_39:0000000058 C
A FALSE
2 RADid_0000003_depth_152:0000000007 G
A,T TRUE
3 RADid_0000003_depth_152:0000000034 G
T,C TRUE
4 RADid_0000003_depth_152:0000000046 T
C FALSE
5 RADid_0000010_depth_57:0000000010 T
C FALSE
... ... ...
... ...
50577 RADid_0078129_depth_31:0000000062 C
T FALSE
50578 RADid_0078132_depth_33:0000000025 T
C FALSE
50579 RADid_0078132_depth_33:0000000033 C
T FALSE
50580 RADid_0078132_depth_33:0000000044 C
A FALSE
50581 RADid_0078132_depth_33:0000000081 C
T FALSE
How do I convert my matrix to a a nucleotide genotype matrix?
I would like my data to look something like:
Sample 1 Snp 1 T/T
Sample 2 Snp 1 T/A
Sample 3 Snp 1 A/A etc.
I noticed that people have been creating their Snp matrix from a txt
file. I am importing from a vcf file and I canât figure out how to
get the desired format.
Thanks a lot for your kind help,
Tereza
[[alternative HTML version deleted]]