def write(year): util.write_header() st.markdown("---") util.write_title("- DISCORD") discord_text_df = get_discord_text(year) discord_voice_df = get_discord_voice(year) if discord_text_df.empty: st.write("EM DESENVOLVIMENTO") return None messages = discord_text_df["messages"].sum() minutes = round(discord_voice_df["speaking_minutes"].sum(), 2) hours = round(minutes / 60, 2) days = round(hours / 24, 2) year = round(days / 365, 1) st.markdown( f"## - No Discord tivemos um total de **{(messages)}** enviadas ") st.markdown( f"## - Além disso, nas messas de bar e canais de áudios tivemos **{(minutes)} minutos** de conversas " ) st.markdown( f"## - Com um total de **{hours} horas** de áudios, o que dá **{days} dias** consecutivo ouvindo tudo !!" ) plot_discord(discord_text_df, discord_voice_df)
def write(year): util.write_header() st.markdown("---") util.write_title("- FEEDBACKS") feedbacks_df = get_event_feedbacks(year) if feedbacks_df.empty: st.write("EM DESENVOLVIMENTO") return None total = feedbacks_df.shape[0] st.markdown( f"## Tivemos um total de **{total}** respostas ao formulário de feedback!!!" ) plot_who(feedbacks_df)
def write(year): util.write_header() st.markdown("---") util.write_title("- LIVES YOUTUBE") lives_df = get_lives_tutorials(year) if lives_df.empty: st.write("EM DESENVOLVIMENTO") return None views = lives_df["Views"].sum() hours = round(lives_df["Watch time (hours)"].sum(), 2) days = round(lives_df["Watch time (days)"].sum(), 2) year = round(days / 365, 1) st.markdown(f"## - Tivemos um total de **{int(views)}** visualizações ") st.markdown( f"## - Com um total de **{hours} horas** de visualizações, o que dá **{days} dias** consecutivo assistindo tudo !!" ) st.markdown( f"## **ISSO DÁ PRATICAMENTE {year} ANOS DE CONTÉUDO SEM PARAR !!!**") plot_youtube(lives_df)
def write(year): util.write_header() st.markdown("---") util.write_title("- PALESTRAS") tickest_df = get_event_tickets(year) if tickest_df.empty: return None col = "Em qual país você reside?" tickest_df[col] = tickest_df[col].str.strip() tickest_df.loc[ tickest_df[col] == "Por favor, que formulário mais sem sentido. Querem também saber que orientação sexual vou querer ter na próxima encarnação? Isso não tem sentido.", col, ] = "N/A" tickest_df.loc[tickest_df[col] == ",", col] = "N/A" tickest_df.loc[tickest_df[col] == "PNR", col] = "N/A" tickest_df.loc[tickest_df[col] == "Prefiro não responder.", col] = "N/A" tickest_df.loc[tickest_df[col] == "Alemanha, Berlin", col] = "Alemanha" tickest_df.loc[tickest_df[col] == "Canada", col] = "Canadá" tickest_df.loc[tickest_df[col] == "Dublin, Irlanda", col] = "Irlanda" tickest_df.loc[tickest_df[col] == "Ireland", col] = "Irlanda" tickest_df.loc[tickest_df[col] == "irlanda", col] = "Irlanda" tickest_df.loc[tickest_df[col] == "Italy", col] = "Itália" tickest_df.loc[tickest_df[col] == "Mocambique", col] = "Moçambique" tickest_df.loc[tickest_df[col] == "Países Baixo", col] = "Países Baixos" tickest_df.loc[tickest_df[col] == "Perú", col] = "Peru" tickest_df.loc[tickest_df[col] == "US", col] = "EUA" tickest_df.loc[tickest_df[col] == "USA", col] = "EUA" tickest_df.loc[tickest_df[col] == "Usa", col] = "EUA" tickest_df.loc[tickest_df[col] == "Estados Unidos", col] = "EUA" tickest_df.loc[tickest_df[col] == "United States", col] = "EUA" tickest_df.loc[tickest_df[col] == "CZ", col] = "República Tcheca" tickest_df.loc[tickest_df[col] == "United Kingdom", col] = "Reino Unido" tickest_df.loc[tickest_df[col] == "colombia", col] = "Colombia" tickest_df.loc[tickest_df[col] == "portugal", col] = "Portugal" tickest_df.loc[tickest_df[col] == "PT", col] = "Portugal" tickest_df.loc[tickest_df[col] == "thailand", col] = "Tailandia" tickest_df.loc[tickest_df[col] == "France", col] = "França" tickest_df.loc[tickest_df[col] == "Japao", col] = "Japão" OPTIONS = ["Inscrições", "Quem", "Onde", "Python"] st.sidebar.title("Dados de Inscrições do Evento") select_column = st.sidebar.selectbox("", OPTIONS) if select_column == "Quem": st.markdown(f"## Detalhes sobre as Quem") plot_who(tickest_df) elif select_column == "Onde": st.markdown(f"## Detalhes sobre as Onde") plot_where(tickest_df) elif select_column == "Python": st.markdown(f"## Detalhes sobre as Python") plot_python(tickest_df) elif select_column == "Inscrições": total = tickest_df.shape[0] st.markdown( f"## Tivemos um total de **{total}** inscrições para o evento !!!") st.markdown(f"## Selecione alguma opção na barra lateral em:") st.markdown(f"## `Dados de Inscrições do Evento` para ver detalhes.") else: st.write("Escolha uma opção")
# Create scripts directory, if it does not exist yet, and cd to it. if not os.path.exists("samtoolsIndex"): os.mkdir("samtoolsIndex") os.chdir("samtoolsIndex") samplesFile = open("../samples.txt") samplesLine = samplesFile.readlines()[1::2] samples = [] lanes = [] for line in samplesLine: samples.append(line.split()[3].split("_")[-2]) lanes.append(line.split()[2].split("_")[-1]) uniquesamples = list(set(samples)) for uniquesample in uniquesamples: # Create script script = open("samtoolsIndex_" + uniquesample + ".sh", "w") util.write_header(script, config, "samtoolsIndex") script.write("samtools sort ../../bismark/" + uniquesample + "/" + uniquesample + "_bismark_pe.bam ../../bismark/" + uniquesample + "/" + uniquesample + "_bismark_pe_sorted") script.write("\n\n") script.write("samtools index ../../bismark/" + uniquesample + "/" + uniquesample + "_bismark_pe_sorted.bam \n") script.close()
os.chdir("coverage_bedgraph") # Read samples files samplesFile = open("../samples.txt") samplesLines = samplesFile.readlines()[1:] samples = [] for line in samplesLines: samples.append(line.split()[3]) # Keep only unique samples. samples = list(set(samples)) for sample in samples: # Open coverage file. coverageFile = glob.glob("../../bismark/" + sample + "/methylation_extractor/" + sample + "_bismark_pe.deduplicated.bismark.cov")[0] # Create script file. scriptName = 'coverage_bedgraph_' + sample + '.sh' script = open(scriptName, 'w') util.write_header(script, config, "coverage_bedgraph") script.write("coverage_bedgraph.py --file=" + coverageFile) script.close() if (args.submitJobsToQueue.lower() == "yes") | (args.submitJobsToQueue.lower() == "y"): subprocess.call("submitJobs.py", shell=True)
config = util.readConfigurationFiles() # Create scripts directory, if it does not exist yet, and cd to it. if not os.path.exists("picardSort"): os.mkdir("picardSort") os.chdir("picardSort") samplesFile = open("../samples.txt") samplesLine = samplesFile.readlines()[1::2] samples = [] lanes = [] for line in samplesLine: samples.append(line.split()[3].split("_")[-2]) uniquesamples = list(set(samples)) for uniquesample in uniquesamples: # Create script script = open("picardSort_" + uniquesample + ".sh", "w") util.write_header(script, config, "picardSort") script.write("samtools sort ../../bismark/" + uniquesample + "/" + uniquesample + ".bam ../../bismark/" + uniquesample + "/" + uniquesample + "_sorted") script.write("\n\n") script.write("samtools index ../../bismark/" + uniquesample + "/" + uniquesample + "_sorted.bam \n") script.close()
samples = [] for line in samplesLine: samples.append(line.split()[3].split("_")[-2]) uniquesamples = list(set(samples)) for sample in uniquesamples: # Create output directory outputDirectory = "../../bismark/" + sample + "/methylation_extractor" if not os.path.exists(outputDirectory): os.mkdir(outputDirectory) bamFile = str(glob.glob("../../bismark/" + sample + "/*.bam"))[2:-2] # Create script file. scriptName = 'methylation_extractor_' + sample + '.sh' script = open(scriptName, 'w') util.write_header(script, config, "methylation_extractor") script.write( "bismark_methylation_extractor --buffer_size 10G --paired --no_overlap --comprehensive --report " + "\\\n") script.write("--bedGraph --CX --cutoff " + config.get('methylation_extractor', 'cutoff') + " " + "\\\n") script.write("--output " + outputDirectory + " " + "\\\n") script.write(bamFile) script.close() if (args.submitJobsToQueue.lower() == "yes") | (args.submitJobsToQueue.lower() == "y"): subprocess.call("submitJobs.py", shell=True)