Sometimes it is necessary to create an empty data frame in R to fill with output. An example would be output from a for loop that loops over SNPs and calculates an association p-value to fill into the empty data frame. The matrix functionality in R makes this easy to do. The code below will create a 100 by 2 matrix and convert it into a dataframe with 100 rows and 2 column variables. The nrow and ncol options are what designate the size of the resulting data frame. The data frame is filled with NA values so that missing values are handled appropriately. Below is some example code:
A repository of programs, scripts, and tips essential to
genetic epidemiology, statistical genetics, and bioinformatics
Welcome to the Genome Toolbox! I am glad you navigated to the blog and hope you find the contents useful and insightful for your genomic needs. If you find any of the entries particularly helpful, be sure to click the +1 button on the bottom of the post and share with your colleagues. Your input is encouraged, so if you have comments or are aware of more efficient tools not included in a post, I would love to hear from you. Enjoy your time browsing through the Toolbox.
Showing posts with label create. Show all posts
Showing posts with label create. Show all posts
Tuesday, April 1, 2014
Wednesday, December 18, 2013
Generate Public/Private RSA Key Pair for SFTP
To access an SFTP server, an SSH public key must be created and shared with the SFTP host. To generate a public/private key pair the ssh-keygen utility in UNIX can be used. This program will calculate a key pair for you by following these steps:
(1) At the UNIX prompt, type ssh-keygen. A message will appear indicating the application is generating the public/private rsa key pair.
(2) You will next be prompted to enter the location where you want to save the key. You can specify a filename or just leave the space blank and press Enter.
(3) Afterwards you will be prompted to enter a passphrase to use as a password. Enter your passphrase here or you can opt to leave the space blank. It is acceptable to simply hit Enter to proceed without specifying a passphrase.
(4) Finally, you will be prompted to re-enter your passphrase.
That is all there is to creating a public and private key pair. To access the remote SFTP server the administrator will need you to forward a copy of your public key to set up your account. The public key will be a file with one line that includes "ssh-rsa", a long key code, followed by your account name and host name (ex: user@host.school.edu). The file extension will be .pub.
(1) At the UNIX prompt, type ssh-keygen. A message will appear indicating the application is generating the public/private rsa key pair.
(2) You will next be prompted to enter the location where you want to save the key. You can specify a filename or just leave the space blank and press Enter.
(3) Afterwards you will be prompted to enter a passphrase to use as a password. Enter your passphrase here or you can opt to leave the space blank. It is acceptable to simply hit Enter to proceed without specifying a passphrase.
(4) Finally, you will be prompted to re-enter your passphrase.
That is all there is to creating a public and private key pair. To access the remote SFTP server the administrator will need you to forward a copy of your public key to set up your account. The public key will be a file with one line that includes "ssh-rsa", a long key code, followed by your account name and host name (ex: user@host.school.edu). The file extension will be .pub.
Subscribe to:
Posts (Atom)