{"action":"created","issue":{"url":"https://api.github.com/repos/alyssafrazee/polyester/issues/21","labels_url":"https://api.github.com/repos/alyssafrazee/polyester/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/alyssafrazee/polyester/issues/21/comments","events_url":"https://api.github.com/repos/alyssafrazee/polyester/issues/21/events","html_url":"https://github.com/alyssafrazee/polyester/issues/21","id":100566669,"number":21,"title":"Error with running simulate experiment for real human transcriptome","user":{"login":"vd4mmind","id":7975435,"avatar_url":"https://avatars.githubusercontent.com/u/7975435?v=3","gravatar_id":"","url":"https://api.github.com/users/vd4mmind","html_url":"https://github.com/vd4mmind","followers_url":"https://api.github.com/users/vd4mmind/followers","following_url":"https://api.github.com/users/vd4mmind/following{/other_user}","gists_url":"https://api.github.com/users/vd4mmind/gists{/gist_id}","starred_url":"https://api.github.com/users/vd4mmind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vd4mmind/subscriptions","organizations_url":"https://api.github.com/users/vd4mmind/orgs","repos_url":"https://api.github.com/users/vd4mmind/repos","events_url":"https://api.github.com/users/vd4mmind/events{/privacy}","received_events_url":"https://api.github.com/users/vd4mmind/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-12T15:12:56Z","updated_at":"2015-08-12T16:07:11Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying to generate simulate reads from the human trascriptome but i am getting error with running the `simulate_experiment`. I am not sure where the error is. I calculated the length of the input transcript and it is more than the input `reads_per_transcript` and the input `fold_change` file am supplying. However am subsetting my transcript file to number of rows in the `fold_change` file and the reads_per_transcript file. I am not sure where the error lies since. Below is my code and the error followed, can you let me know how to get rid of this.\r\n\r\n`library(polyester)`\r\n`library(Biostrings)`\r\n`load(\"/scratch/GT/vdas/benchmark/dataForSimulation.Rdata\",verbose=TRUE) `\r\n`fasta_file = system.file('extdata', 'transcriptome.idx.fa', package='polyester')`\r\n`count_transcripts(fasta_file)` ## number of transcript is in this file is 50221\r\n`length(reads_per_transcript)`\r\n`length(foldchanges)` ## 49628\r\n`dim(foldchanges)`\r\n`fasta = readDNAStringSet(fasta_file)`\r\n`small_fasta = fasta[1:49628]`\r\n`writeXStringSet(small_fasta, 'trancriptome_idx.fa')`\r\n`readspertx = reads_per_transcript`\r\n`simulate_experiment('trancriptome_idx.fa', reads_per_transcript=readspertx, num_reps=c(4,4), readlen=100, paired=TRUE, distr=\"empirical\", error_model=\"illumina5\", bias=\"rnaf\", fold_changes=foldchanges, outdir='simulated_reads')`\r\n\r\nError\r\n```Error in simulate_experiment(\"trancriptome_idx.fa\", reads_per_transcript = 300,  : \r\n  fold_changes must be a vector with one entry per transcript in fasta or gtf; use count_transcripts to find out how many transcripts are in fasta or gtf.```\r\n\r\nI did a traceback\r\n```raceback()\r\n2: stop(.makepretty(\"fold_changes must be a vector with one entry per\\n            transcript in fasta or gtf; use count_transcripts to find out how\\n            many transcripts are in fasta or gtf.\"))\r\n1: simulate_experiment(\"trancriptome_idx.fa\", reads_per_transcript = 300, \r\n       num_reps = c(4, 4), readlen = 100, paired = TRUE, distr = \"empirical\", \r\n       error_model = \"illumina5\", bias = \"rnaf\", fold_changes = foldchanges, \r\n       outdir = \"simulated_reads\")```\r\n\r\nI believe we can provide the reads per transcript and also the fold changes as I did. So where is it getting wrong. Can you tell me?"},"comment":{"url":"https://api.github.com/repos/alyssafrazee/polyester/issues/comments/130356923","html_url":"https://github.com/alyssafrazee/polyester/issues/21#issuecomment-130356923","issue_url":"https://api.github.com/repos/alyssafrazee/polyester/issues/21","id":130356923,"user":{"login":"vd4mmind","id":7975435,"avatar_url":"https://avatars.githubusercontent.com/u/7975435?v=3","gravatar_id":"","url":"https://api.github.com/users/vd4mmind","html_url":"https://github.com/vd4mmind","followers_url":"https://api.github.com/users/vd4mmind/followers","following_url":"https://api.github.com/users/vd4mmind/following{/other_user}","gists_url":"https://api.github.com/users/vd4mmind/gists{/gist_id}","starred_url":"https://api.github.com/users/vd4mmind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vd4mmind/subscriptions","organizations_url":"https://api.github.com/users/vd4mmind/orgs","repos_url":"https://api.github.com/users/vd4mmind/repos","events_url":"https://api.github.com/users/vd4mmind/events{/privacy}","received_events_url":"https://api.github.com/users/vd4mmind/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T16:07:11Z","updated_at":"2015-08-12T16:07:11Z","body":"I modified the code a bit to  make my `small_fasta` have the same transcripts and same length as in the `fold_change` and in the `reads_per_transcript` but still I run with the same error. Do I need to convert the folchange file in matrix format? \r\n\r\n`load(\"/scratch/GT/vdas/benchmark/dataForSimulation.Rdata\",verbose=TRUE) `\r\n`fasta_file = system.file('extdata', 'transcriptome.idx.fa', package='polyester')`\r\n`count_transcripts(fasta_file)` ## number of transcript is in this file is 50221\r\n`length(reads_per_transcript)`\r\n`length(foldchanges)`\r\n`dim(foldchanges)`\r\n`fasta = readDNAStringSet(fasta_file)`\r\n##to get rid of the error the transcript.idx.fa should have th same transcripts in fa, foldchanges and in reads_per_transcript files\r\n`sum(row.names(foldchanges) %in% names(fasta))` # 49273\r\n`foldchanges2 <- foldchanges[which(row.names(foldchanges) %in% names(fasta)),]`\r\n`dim(foldchanges2)` #[1] 49273     8\r\n`small_fasta <- fasta[row.names(foldchanges2)]`\r\n`rpt2 <- reads_per_transcript[row.names(foldchanges2)]`\r\n`length(rpt2)` ## 49273\r\n`writeXStringSet(small_fasta, 'trancriptome_idx.fa')`\r\n`readspertx = rpt2`\r\n`simulate_experiment('trancriptome_idx.fa', reads_per_transcript=readspertx, num_reps=c(4,4), readlen=100, paired=TRUE, distr=\"empirical\", error_model=\"illumina5\", bias=\"rnaf\", fold_changes=foldchanges2, outdir='simulated_reads')`\r\n\r\nCan you tell me why am still getting the same error now?\r\nError\r\n`Error in simulate_experiment(\"trancriptome_idx.fa\", reads_per_transcript = readspertx,  : \r\n  fold_changes must be a vector with one entry per transcript in fasta or gtf; use count_transcripts to find out how many transcripts are in fasta or gtf.`\r\n\r\n"}}