Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging functions to be renamed #7

Open
3 tasks
Tracked by #8
jananiravi opened this issue Sep 18, 2024 · 47 comments
Open
3 tasks
Tracked by #8

Tagging functions to be renamed #7

jananiravi opened this issue Sep 18, 2024 · 47 comments
Assignees
Labels
cleanup Rm deadcode & duplication, streamline documentation Improvements or additions to documentation, incl. R docstring/roxygen2 good first issue Good for newcomers outreachy for outreachy interns package R package dev

Comments

@jananiravi
Copy link
Member

jananiravi commented Sep 18, 2024

  • Identify user-facing functions
  • Identify non-conforming functions | _, . --> camelCase names
  • Tag internal_use functions to start with .
@jananiravi jananiravi mentioned this issue Sep 18, 2024
6 tasks
@jananiravi jananiravi added good first issue Good for newcomers outreachy for outreachy interns labels Oct 1, 2024
@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 2, 2024

On it

@jananiravi jananiravi changed the title Rename functions for consistency Tagging functions to be renamed for consistency Oct 2, 2024
@jananiravi jananiravi changed the title Tagging functions to be renamed for consistency Tagging functions to be renamed Oct 2, 2024
@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 2, 2024

Hi @jananiravi, by tagging, do you mean noting down the function names to be changed? Or should the change be made by a contributor?

@jananiravi
Copy link
Member Author

Yes, you can begin with documenting changes to be made by checking whether the current names follow typical good function nomenclature (e.g., style guide) and whether there's consistency across functions. If there's an agreement, changes can be made -- following confirmation from me or @the-mayer.

For instance,

@jananiravi jananiravi added the documentation Improvements or additions to documentation, incl. R docstring/roxygen2 label Oct 2, 2024
@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 3, 2024

Noted, thanks!

@AleruDivine
Copy link
Collaborator

@jananiravi I wanted to ask if this issue is open for other applicants to contribute as well. I’m interested in getting involved.

@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 3, 2024

Sure! @AleruDivine, I can help you get started and let you know how far I've gotten. it's a lot of function names haha.

@AleruDivine
Copy link
Collaborator

Oh! Thank you so much! I asked to work on another issue seeing you had already started working on this. I hoped to delete this comment. but yes please. I'd love to work on this together.

Let me delete my other comment 🥹

I'm just getting started, going through the resources. I'll reach out in a couple of hours.

Thank you so much!

@balogunadekemi
Copy link

Hi, @jananiravi would it be possible to contribute to this issue? I'm interested in getting involved only if its okay with you

@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 3, 2024

Hi @jananiravi, below are the function names ready to be renamed as soon as approved.

Filename -> acc2lin.r

function name changes
sink.reset -> resetSink
add_lins -> addLineages
acc2lin -> convertAccessionsToLineages
efetch_ipg -> fetchIpgData
ipg2lin -> convertIpgToLineages



filename -> assign_job_queue.R

make_opts2procs -> createOptionsToProcessMapping,

map_advanced_opts2procs ->
retrieveProcessesForAdvancedOptions

get_proc_medians -> calculateMedianRuntimeForProcesses

write_proc_medians_table -> exportMedianRuntimeTableToTsv

write_proc_medians_yml -> exportMedianRuntimeToYaml

get_proc_weights -> retrieveProcessRuntimeWeights

advanced_opts2est_walltime -> calculateEstimatedWalltimeFromOptions



filename -> blastWrappers.R
None



filename -> CHANGED-pre-msa-tree.R

convert_aln2fa -> convertAlignmentToFasta
to_titlecase -> convertToTitleCase
add_leaves -> addLeavesToAlignment
generate_all_aln2fa -> generateAllAlignmentsToFasta
convert_aln2tsv -> convertAlignmentToTsv
convert_accnum2fa -> convertAccessionNumberToFasta
add_name -> addNameColumn
map_acc2name -> mapAccessionToName
rename_fasta -> renameFastaLabels
acc2fa -> accessionsToFasta



filename -> clean_clust_file.R
clean_clust_file -> cleanClusterFile



filename -> cleanup.R

clean_string -> cleanString

string2accnum -> extractAccessionNumber

make_accnums_unique -> ensureUniqueAccessionNumbers

cleanup_fasta_header -> cleanUpFastaHeaders

remove_empty -> removeEmptyRows

repeat2s -> condenseRepeatedDomains

replaceQMs -> replaceQuestionMarks

remove_astrk -> removeAsterisks

remove_tails -> removeLowFrequencyEntries (appear as args in other func)

cleanup_species -> cleanUpSpeciesColumn

cleanup_clust -> cleanUpClusterData

cleanup_domarch -> cleanUpDomainArchitecture

cleanup_gencontext -> cleanUpGenomicContextColumn

cleanup_GeneDesc -> cleanUpGeneDescription

pick_longer_duplicate -> selectLongestDuplicateRecord

cleanup_lineage -> cleanUpLineageData



filename -> colnames_molevol.R

None (Code commented out)



filename -> combine_analysis.R

combine_full -> combineFullAnalysisFiles
combine_ipr -> combineCleanIprFiles



filename -> combine_files.R

combine_files -> combineSimilarFiles



filename -> create_lineage_lookup.R

create_lineage_lookup -> createLineageLookup
shorten_NA -> shortenNA



filename -> fa2domain.R

exec_interproscan -> executeInterProScan
get_df_ipr_col_names -> getInterProScanColumnNames
get_df_ipr_col_types -> getInterProScanColumnTypes
read_iprscan_tsv -> readInterProScanTsv
make_df_iprscan_domains -> createInterProScanDomainTable
df_iprscan_domains2fasta -> convertInterProScanDomainTableToFasta
fasta2fasta_domain -> extractDomainsFromFasta

@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 3, 2024

@jananiravi The remaining function names ready to be changed are as follows ;
Please let me know what you think.



filename -> ipr2viz.R

theme_genes2 -> themeGenes2
find_top_acc -> getTopAccessionsByLineageAndDomarch
ipr2viz -> generateIprScanDomarchVisualization
ipr2viz_web -> generateIprScanDomarchVisualizationWeb



filename -> job_status_emails.R

make_job_results_url -> generateJobResultsUrl
format_job_args -> formatJobArgumentsHtml
get_job_message -> createJobStatusEmailMessage
send_job_status_email -> sendJobStatusEmail



finename -> lineage.R

GCA2lin -> mapGCAIDToTaxIDAndLineage
add_tax -> addTaxIDToData
prot2tax -> mapProteinAccessionsToTaxID
prot2tax_old -> mapProteinAccessionsToTaxIDUsingOldMethod



filename -> msa.R

msa_pdf -> generateMsaPdfFromFasta
generate_msa -> generateMsaUsingKalign



filename -> networks_domarch.R

domain_network -> createDomainNetwork
BinaryDomainNetwork -> createBinaryDomainNetwork



filename -> networks_gencontext.R

gc_undirected_network -> createUndirectedDomainNetwork
GenContextNetwork -> createGenomicContextNetwork



filename -> plotme.R

count_to_sunburst -> generateSunburstPlot
count_to_treemap -> generateTreemapPlot
create_all_col_params -> prepareColumnParameters
create_one_col_params -> prepareSingleColumnParameters
assert_count_df -> validateCountDataFrame
all_non_n_cols_to_char -> .all_non_n_cols_to_char (internal facing)



filename -> plotting.R

shorten_lineage -> shortenLineage
upset.plot -> createUpSetPlot
lineage.DA.plot -> createLineageDaPlot
lineage.Query.plot -> lineageQueryPlot
lineage.neighbors.plot -> lineageNeighborsPlot
lineage.domain_repeats.plot -> lineageDomainRepeatsPlot
LineagePlot -> generateLineagePlot
LevelReduction -> .LevelReduction
GetKingdom -> .GetKingdom
stacked_lin_plot -> createStackedLineagePlot
Wordcloud3 -> generateWordcloud3
wordcloud_element -> createWordCloudElement
wordcloud2_element -> createWordCloud2Element
lineage_sunburst -> generateLineageSunburst
lineage.plot -> plotLineage



filename -> pre-msa-tree.R

RepresentativeAccNums -> generateRepresentativeAccessionNumbers
write.MsaAAMultipleAlignment -> exportMsaAaMultipleAlignmentToFasta
get_accnums_from_fasta_file -> extractAccessionNumbersFromFasta



filename -> query_blast.R
empty



filename -> reverse_operons.R

reveql -> straightenOperonSequence
reverse_operon -> reverseOperonSequence



filename -> reverse_operons.R
Same as above



filename -> summarize.R

filter_by_doms -> filterByDomains
count_bycol -> countByColumn
elements2words -> elementsToWords
words2wc -> wordsToWordCounts
filter_freq -> filterByFrequency
summarize_bylin -> summarizeByLineage
summ.DA.byLin -> summarizeDomainArchitectureByLineage
summ.DA -> summarizeDomainArchitecture
summ.GC.byDALin -> summarizeGenomicContextByDomainArchitectureAndLineage
summ.GC.byLin -> summarizeGenomicContextByLineage
summ.GC -> summarizeGenomicContext
total_counts -> totalGenomicOrDomainArchitectureCounts



filename -> tree.R

convert_fa2tre -> convertFastaToTree
generate_trees -> generateTreesFromAlignments
generate_fa2tre -> generateTreeFromFasta

@jananiravi
Copy link
Member Author

@the-mayer, let's go through these changes and finalize so the outreachy folks can figure out next steps.

@jananiravi
Copy link
Member Author

@Seyi007, now's a good time to check this list & also pop into #3 & see if any functions are missing in the inventory. So reach out to folks who are working on that & #26 to update all function names and if any are missing. @the-mayer is this file only on molevol_scripts still? Should we start creating a md for it here in this repo?

@jananiravi
Copy link
Member Author

yes, @balogunadekemi, tag along with Seyi for the next task in line.

@the-mayer
Copy link
Collaborator

@Seyi007, now's a good time to check this list & also pop into #3 & see if any functions are missing in the inventory. So reach out to folks who are working on that & #26 to update all function names and if any are missing. @the-mayer is this file only on molevol_scripts still? Should we start creating a md for it here in this repo?

@jananiravi, the contents of issue #3 were populated from this README, so I believe we’ve successfully transitioned from molevol_scripts. To keep this package repo clean and avoid cluttering .Rbuildignore with miscellaneous files, I suggest we handle the function inventory and related tasks as issues or discussions moving forward.

Good call on using the pkgdown Reference tab as a guide. This list should comprehensively cover existing functions with docstrings that are exported and can also highlight where documentation is missing.

@jananiravi jananiravi added the package R package dev label Oct 4, 2024
@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 4, 2024

@Seyi007, now's a good time to check this list & also pop into #3 & see if any functions are missing in the inventory. So reach out to folks who are working on that & #26 to update all function names and if any are missing. @the-mayer is this file only on molevol_scripts still? Should we start creating a md for it here in this repo?

Found and updated the following function from the package index link:

DownloadAssemblySummary -> downloadAssemblySummary
assign_job_queue -> assignJobQueue
find_paralogs -> findParalogGenes
plot_estimated_walltimes -> plotEstimatedWallTimes
run_deltablast -> runDeltaBlast
run_rpsblast -> runRpsBlast

Now it seems all the function names have been covered and updated! @jananiravi. For clarity, should the internal facing functions also be in camel cases starting with a dot(.)? Or? snake cases starting with a dot(.)

@jananiravi
Copy link
Member Author

Maybe we can go with .camelCase for consistency.

@Joiejoie1 Joiejoie1 self-assigned this Oct 4, 2024
@the-mayer
Copy link
Collaborator

Thanks, everyone, for your patience. @jananiravi and I have had the chance to discuss.

Using @Seyi007’s comments as a base, I’m going to create several follow-up posts with proposed function name changes. These will be roughly divided by filename. Please feel free to convert each separate comment into a new issue so that multiple individuals may work on this, if desired.

NOTE: Before beginning to work on a particular file, please check to see that @jananiravi has given the 👍 on the comment.

The comments that follow will all follow a similar format:
R/path_to_file.R

Original Modified User Facing
original_function newFunction

Please follow the contributing guidelines and create a new branch containing your changes. Commit your work, and submit a PR when ready for review.

@the-mayer
Copy link
Collaborator

the-mayer commented Oct 4, 2024

R/acc2lin.R

Original Modified User Facing
sink.reset sinkReset
add_lins addLineages
acc2lin acc2Lineage
efetch_ipg efetchIPG
ipg2lin IPG2Lineage

@the-mayer
Copy link
Collaborator

the-mayer commented Oct 4, 2024

R/assign_job_queue.R

Original Modified User Facing
assign_job_queue assignJobQueue
make_opts2procs createOptions2ProcessMapping ❓mapOption2Process
map_advanced_opts2procs getProcessesForAdvancedOptions ❓mapAdvOption2Process
get_proc_medians calculateProcessRuntime
write_proc_medians_table writeProcessRuntime2TSV
write_proc_medians_yml writeProcessRuntime2YML
get_proc_weights getProcessRuntimeWeights
advanced_opts2est_walltime calculateEstimatedWallTimeFromOpts
plot_estimated_walltimes plotEstimatedWallTimes

@jananiravi
Copy link
Member Author

@Seyi007, I made some changes here yesterday & in the spin-off issues you created. Can you double-check to make sure consistent changes have been made throughout? Thanks for splitting them up!

@jananiravi
Copy link
Member Author

thanks again, @the-mayer! @Seyi007 @teddyCodex, made a few changes above in the issues & in the PRs, but I'm sure I've missed something. In principle,
DomainArchitecture / DomainArch / DomArch --> DomArch
GenomicContext --> GenContext
Interproscan --> IPRscan

let me know if you find anything else that seems inconsistent or something we may have missed. thanks!

@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 7, 2024

thanks again, @the-mayer! @Seyi007 @teddyCodex, made a few changes above in the issues & in the PRs, but I'm sure I've missed something. In principle, DomainArchitecture / DomainArch / DomArch --> DomArch GenomicContext --> GenContext Interproscan --> IPRscan

let me know if you find anything else that seems inconsistent or something we may have missed. thanks!

Hi @jananiravi, are the new names to be for the above listed function names genContext and IPRscan? Also what does the '?' under the user facing column signify?

@teddyCodex
Copy link
Collaborator

thanks again, @the-mayer! @Seyi007 @teddyCodex, made a few changes above in the issues & in the PRs, but I'm sure I've missed something. In principle, DomainArchitecture / DomainArch / DomArch --> DomArch GenomicContext --> GenContext Interproscan --> IPRscan
let me know if you find anything else that seems inconsistent or something we may have missed. thanks!

Hi @jananiravi, are the new names to be for the above listed function names genContext and IPRscan?

I believe so @Seyi007 already implemented and raised a PR for that file.

@Seyi007
Copy link
Collaborator

Seyi007 commented Oct 7, 2024

thanks again, @the-mayer! @Seyi007 @teddyCodex, made a few changes above in the issues & in the PRs, but I'm sure I've missed something. In principle, DomainArchitecture / DomainArch / DomArch --> DomArch GenomicContext --> GenContext Interproscan --> IPRscan
let me know if you find anything else that seems inconsistent or something we may have missed. thanks!

Hi @jananiravi, are the new names to be for the above listed function names genContext and IPRscan?

I believe so @Seyi007 already implemented and raised a PR for that file.

Okay good one!

@Joiejoie1
Copy link
Collaborator

Can I work on this too? #67 or is someone working on that already?

@Joiejoie1
Copy link
Collaborator

Can I work on this too? #67 or is someone working on that already?

I see @teddyCodex has worked on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Rm deadcode & duplication, streamline documentation Improvements or additions to documentation, incl. R docstring/roxygen2 good first issue Good for newcomers outreachy for outreachy interns package R package dev
Projects
None yet
Development

No branches or pull requests

7 participants